Skip to content

Commit c344019

Browse files
ArvindYadavCsgregkh
authored andcommitted
media: imon: Fix null-ptr-deref in imon_probe
commit 58fd55e 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 <[email protected]> Tested-by: Andrey Konovalov <[email protected]> Signed-off-by: Sean Young <[email protected]> Signed-off-by: Mauro Carvalho Chehab <[email protected]> Cc: Ben Hutchings <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent 0cbac00 commit c344019

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
@@ -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)