]> git.baikalelectronics.ru Git - kernel.git/commit
Revert "usb: typec: ucsi: add a common function ucsi_unregister_connectors()"
authorTakashi Iwai <tiwai@suse.de>
Tue, 23 Aug 2022 06:54:55 +0000 (08:54 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 23 Aug 2022 07:28:11 +0000 (09:28 +0200)
commit7440039249f5760f8bf5ab74c9eb7783fab40903
tree8060890b3083cf8ac2e8b8a11b974aee0672eb1f
parent0c5faae61d6880301a231146dddfe7e7d29c65ff
Revert "usb: typec: ucsi: add a common function ucsi_unregister_connectors()"

The recent commit cc8f573c9aa7 ("usb: typec: ucsi: add a common
function ucsi_unregister_connectors()") introduced a regression that
caused NULL dereference at reading the power supply sysfs.  It's a
stale sysfs entry that should have been removed but remains with NULL
ops.  The commit changed the error handling to skip the entries after
a NULL con->wq, and this leaves the power device unreleased.

For addressing the regression, the straight revert is applied here.
Further code improvements can be done from the scratch again.

Link: https://bugzilla.suse.com/show_bug.cgi?id=1202386
Link: https://lore.kernel.org/r/87r11cmbx0.wl-tiwai@suse.de
Fixes: cc8f573c9aa7 ("usb: typec: ucsi: add a common function ucsi_unregister_connectors()")
Cc: <stable@vger.kernel.org>
Acked-by: Heikki Krogerus <heikki.krogerus@linux.intel.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Link: https://lore.kernel.org/r/20220823065455.32579-1-tiwai@suse.de
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/usb/typec/ucsi/ucsi.c