]> git.baikalelectronics.ru Git - kernel.git/commit
media: cpia2_usb: first wake up, then free in disconnect
authorOliver Neukum <oneukum@suse.com>
Thu, 9 May 2019 08:57:09 +0000 (04:57 -0400)
committerMauro Carvalho Chehab <mchehab+samsung@kernel.org>
Tue, 28 May 2019 16:26:11 +0000 (12:26 -0400)
commit4e35428ee66b2e59ade0ee117e8d576eb4c84c3b
tree38d309e888039ef6d5eedfe77a77048245a69840
parent333bce776f6c14f9da790ec620a54f160acf95f0
media: cpia2_usb: first wake up, then free in disconnect

Kasan reported a use after free in cpia2_usb_disconnect()
It first freed everything and then woke up those waiting.
The reverse order is correct.

Fixes: 1f620f3d706bb ("[media] cpia2: major overhaul to get it in a working state again")
Signed-off-by: Oliver Neukum <oneukum@suse.com>
Reported-by: syzbot+0c90fc937c84f97d0aa6@syzkaller.appspotmail.com
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
drivers/media/usb/cpia2/cpia2_usb.c