mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-29 11:11:45 -04:00
usblp: poison URBs upon disconnect
[ Upstream commit 296a193b06120aa6ae7cf5c0d7b5e5b55968026e ] syzkaller reported an URB that should have been killed to be active. We do not understand it, but this should fix the issue if it is real. Signed-off-by: Oliver Neukum <[email protected]> Reported-by: [email protected] Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Greg Kroah-Hartman <[email protected]> Signed-off-by: Sasha Levin <[email protected]>
This commit is contained in:
parent
cc9024f69b
commit
9e6a9201b7
1 changed files with 4 additions and 1 deletions
|
|
@ -468,7 +468,8 @@ static int usblp_release(struct inode *inode, struct file *file)
|
|||
usb_autopm_put_interface(usblp->intf);
|
||||
|
||||
if (!usblp->present) /* finish cleanup from disconnect */
|
||||
usblp_cleanup(usblp);
|
||||
usblp_cleanup(usblp); /* any URBs must be dead */
|
||||
|
||||
mutex_unlock(&usblp_mutex);
|
||||
return 0;
|
||||
}
|
||||
|
|
@ -1375,9 +1376,11 @@ static void usblp_disconnect(struct usb_interface *intf)
|
|||
|
||||
usblp_unlink_urbs(usblp);
|
||||
mutex_unlock(&usblp->mut);
|
||||
usb_poison_anchored_urbs(&usblp->urbs);
|
||||
|
||||
if (!usblp->used)
|
||||
usblp_cleanup(usblp);
|
||||
|
||||
mutex_unlock(&usblp_mutex);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue