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

Commit 0bfef4cd authored by Manoj Prabhu B's avatar Manoj Prabhu B Committed by Gerrit - the friendly Code Review server
Browse files

diag: Read from USB without holding spinlock



Prevent possible deadlock scenario of trying to acquire same
spinlock by not holding the spinlock when reading off USB.

Change-Id: Idf979b6b28ca084cc75c1f23ca03211c5952a1a2
Signed-off-by: default avatarManoj Prabhu B <bmanoj@codeaurora.org>
parent 6cb02c40
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -312,7 +312,9 @@ static void usb_read_work_fn(struct work_struct *work)
		atomic_set(&ch->read_pending, 1);
		req->buf = ch->read_buf;
		req->length = USB_MAX_OUT_BUF;
		spin_unlock_irqrestore(&ch->lock, flags);
		err = usb_diag_read(ch->hdl, req);
		spin_lock_irqsave(&ch->lock, flags);
		if (err) {
			pr_debug("diag: In %s, error in reading from USB %s, err: %d\n",
				 __func__, ch->name, err);