]> git.proxmox.com Git - mirror_ubuntu-bionic-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)
committerKhalid Elmously <khalid.elmously@canonical.com>
Wed, 29 Jan 2020 04:45:21 +0000 (23:45 -0500)
commitf21e5bd378f32534f2daca3477d69aa07f945287
treeea604f11eb1372871f922360f22e84143dd26c21
parentd0c7770ed88d5ae633ebac93e5988fa11f8aeb62
media: flexcop-usb: fix NULL-ptr deref in flexcop_usb_transfer_init()

BugLink: https://bugs.launchpad.net/bugs/1859712
[ 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>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
Signed-off-by: Khalid Elmously <khalid.elmously@canonical.com>
drivers/media/usb/b2c2/flexcop-usb.c