From: Dan Carpenter Date: Fri, 9 May 2014 11:55:09 +0000 (-0300) Subject: [media] Staging: dt3155v4l: set error code on failure X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=5b340ea0caac4c123a3bb989a43c021a2dc06fb2;p=GitHub%2FLineageOS%2Fandroid_kernel_motorola_exynos9610.git [media] Staging: dt3155v4l: set error code on failure We should be returning -ENOMEM here instead of success. Signed-off-by: Dan Carpenter Reviewed-by: Jingoo Han Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab --- diff --git a/drivers/staging/media/dt3155v4l/dt3155v4l.c b/drivers/staging/media/dt3155v4l/dt3155v4l.c index 14bdc19ec48f..40580228a6c7 100644 --- a/drivers/staging/media/dt3155v4l/dt3155v4l.c +++ b/drivers/staging/media/dt3155v4l/dt3155v4l.c @@ -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 */