]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
[media] mceusb: fix NULL-deref at probe
authorJohan Hovold <johan@kernel.org>
Tue, 7 Mar 2017 18:14:13 +0000 (15:14 -0300)
committerMauro Carvalho Chehab <mchehab@s-opensource.com>
Fri, 24 Mar 2017 11:28:25 +0000 (08:28 -0300)
Make sure to check for the required out endpoint to avoid dereferencing
a NULL-pointer in mce_request_packet should a malicious device lack such
an endpoint. Note that this path is hit during probe.

Fixes: 66e89522aff7 ("V4L/DVB: IR: add mceusb IR receiver driver")
Cc: stable <stable@vger.kernel.org> # 2.6.36
Signed-off-by: Johan Hovold <johan@kernel.org>
Signed-off-by: Sean Young <sean@mess.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
drivers/media/rc/mceusb.c

index 238d8eaf7d94f8e2a1346b4c9889176d8a21e3b0..93b16fe3ab382c158198101db1e872ac78eb7614 100644 (file)
@@ -1288,8 +1288,8 @@ static int mceusb_dev_probe(struct usb_interface *intf,
                        }
                }
        }
-       if (ep_in == NULL) {
-               dev_dbg(&intf->dev, "inbound and/or endpoint not found");
+       if (!ep_in || !ep_out) {
+               dev_dbg(&intf->dev, "required endpoints not found\n");
                return -ENODEV;
        }