mirror of
https://github.com/raspberrypi/linux.git
synced 2025-12-06 10:00:17 +00:00
Revert "usb: typec: class: fix typec_altmode_put_partner to put plugs"
commit9c6b789e95upstream. This reverts commitb17b7fe6dd. That commit messed up the reference counting, so it needs to be rethought. Fixes:b17b7fe6dd("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> Link: https://lore.kernel.org/r/20240102091142.2136472-1-heikki.krogerus@linux.intel.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
9f8b94b93c
commit
745a4b3527
@@ -266,7 +266,7 @@ static void typec_altmode_put_partner(struct altmode *altmode)
|
||||
if (!partner)
|
||||
return;
|
||||
|
||||
adev = &altmode->adev;
|
||||
adev = &partner->adev;
|
||||
|
||||
if (is_typec_plug(adev->dev.parent)) {
|
||||
struct typec_plug *plug = to_typec_plug(adev->dev.parent);
|
||||
@@ -496,8 +496,7 @@ static void typec_altmode_release(struct device *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);
|
||||
kfree(alt);
|
||||
|
||||
Reference in New Issue
Block a user