Skip to content

Commit 2f95dfb

Browse files
Heikki Krogerusgregkh
authored andcommitted
usb: typec: ucsi: displayport: Fix potential deadlock
commit b791a67 upstream. 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 <mathias.nyman@linux.intel.com> Fixes: af8622f ("usb: typec: ucsi: Support for DisplayPort alt mode") Cc: stable@vger.kernel.org Signed-off-by: Heikki Krogerus <heikki.krogerus@linux.intel.com> Link: https://lore.kernel.org/r/20240507134316.161999-1-heikki.krogerus@linux.intel.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent a202b26 commit 2f95dfb

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)