Skip to content

Commit b791a67

Browse files
Heikki Krogerusgregkh
authored andcommitted
usb: typec: ucsi: displayport: Fix potential deadlock
The function ucsi_displayport_work() does not access the connector, so it also must not acquire the connector lock. This fixes a potential deadlock scenario: ucsi_displayport_work() -> lock(&con->lock) typec_altmode_vdm() dp_altmode_vdm() dp_altmode_work() typec_altmode_enter() ucsi_displayport_enter() -> lock(&con->lock) Reported-by: Mathias Nyman <[email protected]> Fixes: af8622f ("usb: typec: ucsi: Support for DisplayPort alt mode") Cc: [email protected] Signed-off-by: Heikki Krogerus <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent 718b36a commit b791a67

File tree

1 file changed

+0
-4
lines changed

1 file changed

+0
-4
lines changed

drivers/usb/typec/ucsi/displayport.c

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -275,8 +275,6 @@ static void ucsi_displayport_work(struct work_struct *work)
275275
struct ucsi_dp *dp = container_of(work, struct ucsi_dp, work);
276276
int ret;
277277

278-
mutex_lock(&dp->con->lock);
279-
280278
ret = typec_altmode_vdm(dp->alt, dp->header,
281279
dp->vdo_data, dp->vdo_size);
282280
if (ret)
@@ -285,8 +283,6 @@ static void ucsi_displayport_work(struct work_struct *work)
285283
dp->vdo_data = NULL;
286284
dp->vdo_size = 0;
287285
dp->header = 0;
288-
289-
mutex_unlock(&dp->con->lock);
290286
}
291287

292288
void ucsi_displayport_remove_partner(struct typec_altmode *alt)

0 commit comments

Comments
 (0)