]> git.baikalelectronics.ru Git - kernel.git/commit
media: flexcop-usb: fix NULL-ptr deref in flexcop_usb_transfer_init()
authorYang Yingliang <yangyingliang@huawei.com>
Tue, 24 Sep 2019 09:49:04 +0000 (06:49 -0300)
committerMauro Carvalho Chehab <mchehab+samsung@kernel.org>
Mon, 7 Oct 2019 10:51:17 +0000 (07:51 -0300)
commitb0c522a744d96c4a5858d056b5c43ba9618de24f
tree76be8bf5e14fbc1f88f2dd98eae5df7faeac9354
parent6069b8d512de9eabcaec033b7145b4c654997607
media: flexcop-usb: fix NULL-ptr deref in flexcop_usb_transfer_init()

If usb_set_interface() failed, iface->cur_altsetting will
not be assigned and it will be used in flexcop_usb_transfer_init()
It may lead a NULL pointer dereference.

Check usb_set_interface() return value in flexcop_usb_init()
and return failed to avoid using this NULL pointer.

Signed-off-by: Yang Yingliang <yangyingliang@huawei.com>
Signed-off-by: Sean Young <sean@mess.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
drivers/media/usb/b2c2/flexcop-usb.c