mirror of
https://mirrors.bfsu.edu.cn/git/linux.git
synced 2024-12-15 15:04:27 +08:00
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 <mathias.nyman@linux.intel.com>
Fixes: af8622f6a5
("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>
This commit is contained in:
parent
718b36a7b4
commit
b791a67f68
@ -275,8 +275,6 @@ static void ucsi_displayport_work(struct work_struct *work)
|
|||||||
struct ucsi_dp *dp = container_of(work, struct ucsi_dp, work);
|
struct ucsi_dp *dp = container_of(work, struct ucsi_dp, work);
|
||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
mutex_lock(&dp->con->lock);
|
|
||||||
|
|
||||||
ret = typec_altmode_vdm(dp->alt, dp->header,
|
ret = typec_altmode_vdm(dp->alt, dp->header,
|
||||||
dp->vdo_data, dp->vdo_size);
|
dp->vdo_data, dp->vdo_size);
|
||||||
if (ret)
|
if (ret)
|
||||||
@ -285,8 +283,6 @@ static void ucsi_displayport_work(struct work_struct *work)
|
|||||||
dp->vdo_data = NULL;
|
dp->vdo_data = NULL;
|
||||||
dp->vdo_size = 0;
|
dp->vdo_size = 0;
|
||||||
dp->header = 0;
|
dp->header = 0;
|
||||||
|
|
||||||
mutex_unlock(&dp->con->lock);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void ucsi_displayport_remove_partner(struct typec_altmode *alt)
|
void ucsi_displayport_remove_partner(struct typec_altmode *alt)
|
||||||
|
Loading…
Reference in New Issue
Block a user