mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-06 02:50:49 +09:00
UPSTREAM: Revert "usb: typec: class: fix typec_altmode_put_partner to put plugs"
This reverts commit b17b7fe6dd5c6ff74b38b0758ca799cdbb79e26e.
That commit messed up the reference counting, so it needs to
be rethought.
Fixes: b17b7fe6dd5c ("usb: typec: class: fix typec_altmode_put_partner to put plugs")
Cc: stable@vger.kernel.org
Cc: RD Babiera <rdbabiera@google.com>
Reported-by: Chris Bainbridge <chris.bainbridge@gmail.com>
Closes: https://lore.kernel.org/lkml/CAP-bSRb3SXpgo_BEdqZB-p1K5625fMegRZ17ZkPE1J8ZYgEHDg@mail.gmail.com/
Signed-off-by: Heikki Krogerus <heikki.krogerus@linux.intel.com>
Bug: 324496488
(cherry picked from commit 9c6b789e954fae73c548f39332bcc56bdf0d4373)
Change-Id: I2755a5e44dd1970d60e5d996dd7fc6d88f79684a
Signed-off-by: RD Babiera <rdbabiera@google.com>
This commit is contained in:
@@ -267,7 +267,7 @@ static void typec_altmode_put_partner(struct altmode *altmode)
|
|||||||
if (!partner)
|
if (!partner)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
adev = &altmode->adev;
|
adev = &partner->adev;
|
||||||
|
|
||||||
if (is_typec_plug(adev->dev.parent)) {
|
if (is_typec_plug(adev->dev.parent)) {
|
||||||
struct typec_plug *plug = to_typec_plug(adev->dev.parent);
|
struct typec_plug *plug = to_typec_plug(adev->dev.parent);
|
||||||
@@ -497,8 +497,7 @@ static void typec_altmode_release(struct device *dev)
|
|||||||
{
|
{
|
||||||
struct altmode *alt = to_altmode(to_typec_altmode(dev));
|
struct altmode *alt = to_altmode(to_typec_altmode(dev));
|
||||||
|
|
||||||
if (!is_typec_port(dev->parent))
|
typec_altmode_put_partner(alt);
|
||||||
typec_altmode_put_partner(alt);
|
|
||||||
|
|
||||||
altmode_id_remove(alt->adev.dev.parent, alt->id);
|
altmode_id_remove(alt->adev.dev.parent, alt->id);
|
||||||
kfree(alt);
|
kfree(alt);
|
||||||
|
|||||||
Reference in New Issue
Block a user