summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrei Kuchynski <akuchynski@chromium.org>2025-04-24 08:44:29 +0000
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2025-05-18 08:24:55 +0200
commit5ad298d6d4aebe1229adba6427e417e89a5208d8 (patch)
tree2111765f6494d9b61a6c486555d328d84e1d4181
parent3366a199483a247e6610fdc9c1de65df68624c7e (diff)
usb: typec: ucsi: displayport: Fix NULL pointer access
commit 312d79669e71283d05c05cc49a1a31e59e3d9e0e upstream. This patch ensures that the UCSI driver waits for all pending tasks in the ucsi_displayport_work workqueue to finish executing before proceeding with the partner removal. Cc: stable <stable@kernel.org> Fixes: af8622f6a585 ("usb: typec: ucsi: Support for DisplayPort alt mode") Signed-off-by: Andrei Kuchynski <akuchynski@chromium.org> Reviewed-by: Heikki Krogerus <heikki.krogerus@linux.intel.com> Reviewed-by: Benson Leung <bleung@chromium.org> Link: https://lore.kernel.org/r/20250424084429.3220757-3-akuchynski@chromium.org Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r--drivers/usb/typec/ucsi/displayport.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/usb/typec/ucsi/displayport.c b/drivers/usb/typec/ucsi/displayport.c
index 420af5139c70..5d24a2321e15 100644
--- a/drivers/usb/typec/ucsi/displayport.c
+++ b/drivers/usb/typec/ucsi/displayport.c
@@ -296,6 +296,8 @@ void ucsi_displayport_remove_partner(struct typec_altmode *alt)
if (!dp)
return;
+ cancel_work_sync(&dp->work);
+
dp->data.conf = 0;
dp->data.status = 0;
dp->initialized = false;