[media] s2255drv: fix memory leak s2255_probe()
authorDaeseok Youn <daeseok.youn@gmail.com>
Thu, 8 May 2014 22:57:18 +0000 (19:57 -0300)
committerMauro Carvalho Chehab <m.chehab@samsung.com>
Fri, 23 May 2014 15:19:42 +0000 (12:19 -0300)
smatch says:
 drivers/media/usb/s2255/s2255drv.c:2246 s2255_probe() warn:
possible memory leak of 'dev'

Signed-off-by: Daeseok Youn <daeseok.youn@gmail.com>
Acked-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
drivers/media/usb/s2255/s2255drv.c

index 185be72cab14c309d0b333ff436787fd018cc1a0..a44466bc7b86f4aae5d79510757e7a45abb91c28 100644 (file)
@@ -2242,7 +2242,7 @@ static int s2255_probe(struct usb_interface *interface,
        dev->cmdbuf = kzalloc(S2255_CMDBUF_SIZE, GFP_KERNEL);
        if (dev->cmdbuf == NULL) {
                s2255_dev_err(&interface->dev, "out of memory\n");
-               return -ENOMEM;
+               goto errorFWDATA1;
        }
 
        atomic_set(&dev->num_channels, 0);