Skip to content

Commit c344019

Browse files
ArvindYadavCsgregkh
authored andcommitted
media: imon: Fix null-ptr-deref in imon_probe
commit 58fd55e838276a0c13d1dc7c387f90f25063cbf3 upstream. It seems that the return value of usb_ifnum_to_if() can be NULL and needs to be checked. Signed-off-by: Arvind Yadav <arvind.yadav.cs@gmail.com> Tested-by: Andrey Konovalov <andreyknvl@google.com> Signed-off-by: Sean Young <sean@mess.org> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com> Cc: Ben Hutchings <ben.hutchings@codethink.co.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent 0cbac00 commit c344019

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

drivers/media/rc/imon.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2419,6 +2419,11 @@ static int imon_probe(struct usb_interface *interface,
24192419
mutex_lock(&driver_lock);
24202420

24212421
first_if = usb_ifnum_to_if(usbdev, 0);
2422+
if (!first_if) {
2423+
ret = -ENODEV;
2424+
goto fail;
2425+
}
2426+
24222427
first_if_ctx = usb_get_intfdata(first_if);
24232428

24242429
if (ifnum == 0) {

0 commit comments

Comments
 (0)