[media] Staging: dt3155v4l: set error code on failure
authorDan Carpenter <dan.carpenter@oracle.com>
Fri, 9 May 2014 11:55:09 +0000 (08:55 -0300)
committerMauro Carvalho Chehab <m.chehab@samsung.com>
Fri, 23 May 2014 22:48:28 +0000 (19:48 -0300)
We should be returning -ENOMEM here instead of success.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Reviewed-by: Jingoo Han <jg1.han@samsung.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
drivers/staging/media/dt3155v4l/dt3155v4l.c

index 14bdc19ec48fad74058138672aebdd8de6b82951..40580228a6c72d1e169ae5de2d2ed6318645af88 100644 (file)
@@ -906,8 +906,10 @@ dt3155_probe(struct pci_dev *pdev, const struct pci_device_id *id)
        if (!pd)
                return -ENOMEM;
        pd->vdev = video_device_alloc();
-       if (!pd->vdev)
+       if (!pd->vdev) {
+               err = -ENOMEM;
                goto err_video_device_alloc;
+       }
        *pd->vdev = dt3155_vdev;
        pci_set_drvdata(pdev, pd);    /* for use in dt3155_remove() */
        video_set_drvdata(pd->vdev, pd);  /* for use in video_fops */