]> 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)
commitf658cd7e4e22d0e702565ee12dd928835b14ea9e
tree8060890b3083cf8ac2e8b8a11b974aee0672eb1f
parentf143ef3b5f614896ab6f13439f11bfb5f4d4700a
Revert "usb: typec: ucsi: add a common function ucsi_unregister_connectors()"

The recent commit 42d51c349ca0 ("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: 42d51c349ca0 ("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