]> git.ipfire.org Git - thirdparty/kernel/stable.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)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 4 Jan 2020 12:39:16 +0000 (13:39 +0100)
commitfcc34c44d1fe073fa67a31eeed32a87bf0dcefdd
tree3ed1124d86e94e0b1f5294d25d1364ea64189fd8
parent1ad0a69cb63bfe4f0b5399dd6410aa230a49ef25
media: flexcop-usb: fix NULL-ptr deref in flexcop_usb_transfer_init()

[ Upstream commit 649cd16c438f51d4cd777e71ca1f47f6e0c5e65d ]

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>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/media/usb/b2c2/flexcop-usb.c