Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Skip to content
Commit 193d3ec5 authored by Ajay Agarwal's avatar Ajay Agarwal
Browse files

usb: misc: diag_bridge: Fix potential mutex deadlock



Consider that read/write is in progress and passed all sanity
checks and proceeded for allocation/submission of URB. It might
be possible that during the same time, the disconnect and close
functions got called from core diag driver and updated the kref
counter to 1. Then if the ongoing read/write fails due to some
reason, then it tries to decrement kref count with the lock still
held. And in the delete function, we again try to get the same
lock resulting in deadlock scenario.
Fix this by adding lock protection in open and close functions.
This will ensure that the delete() is called by the close
function only and hence no deadlock.

Change-Id: Ie62f2f251bca660b17e4b61445cce23e30f1ca00
Signed-off-by: default avatarAjay Agarwal <ajaya@codeaurora.org>
parent 0f0132aa
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment