[media] rc/redrat3: dereferencing null pointer
authorDan Carpenter <error27@gmail.com>
Thu, 26 May 2011 08:55:08 +0000 (05:55 -0300)
committerMauro Carvalho Chehab <mchehab@redhat.com>
Wed, 27 Jul 2011 20:52:24 +0000 (17:52 -0300)
In the original code, if the allocation failed we dereference "rr3"
when it was NULL.

Acked-by: Jarod Wilson <jarod@redhat.com>
Signed-off-by: Dan Carpenter <error27@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
drivers/media/rc/redrat3.c

index 5147767..4582ef7 100644 (file)
@@ -1186,7 +1186,7 @@ static int __devinit redrat3_dev_probe(struct usb_interface *intf,
        rr3 = kzalloc(sizeof(*rr3), GFP_KERNEL);
        if (rr3 == NULL) {
                dev_err(dev, "Memory allocation failure\n");
-               goto error;
+               goto no_endpoints;
        }
 
        rr3->dev = &intf->dev;