Skip to content

Commit 58fd55e

Browse files
ArvindYadavCsmchehab
authored andcommitted
media: imon: Fix null-ptr-deref in imon_probe
It seems that the return value of usb_ifnum_to_if() can be NULL and needs to be checked. Signed-off-by: Arvind Yadav <[email protected]> Tested-by: Andrey Konovalov <[email protected]> Signed-off-by: Sean Young <[email protected]> Signed-off-by: Mauro Carvalho Chehab <[email protected]>
1 parent bbae615 commit 58fd55e

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

drivers/media/rc/imon.c

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

25172517
first_if = usb_ifnum_to_if(usbdev, 0);
2518+
if (!first_if) {
2519+
ret = -ENODEV;
2520+
goto fail;
2521+
}
2522+
25182523
first_if_ctx = usb_get_intfdata(first_if);
25192524

25202525
if (ifnum == 0) {

0 commit comments

Comments
 (0)