Skip to content

Commit

Permalink
[media] V4L: mx1-camera: fix uninitialized variable
Browse files Browse the repository at this point in the history
mx1_camera_add_device() can return an uninitialized value of ret.

Signed-off-by: Andre Bartke <andre.bartke@gmail.com>
[g.liakhovetski@gmx.de: modified the fix to remove "ret" completely]
Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
  • Loading branch information
Andre Bartke authored and Mauro Carvalho Chehab committed Jul 1, 2011
1 parent 383e4f6 commit 258c056
Showing 1 changed file with 3 additions and 7 deletions.
10 changes: 3 additions & 7 deletions drivers/media/video/mx1_camera.c
Original file line number Diff line number Diff line change
Expand Up @@ -444,12 +444,9 @@ static int mx1_camera_add_device(struct soc_camera_device *icd)
{
struct soc_camera_host *ici = to_soc_camera_host(icd->dev.parent);
struct mx1_camera_dev *pcdev = ici->priv;
int ret;

if (pcdev->icd) {
ret = -EBUSY;
goto ebusy;
}
if (pcdev->icd)
return -EBUSY;

dev_info(icd->dev.parent, "MX1 Camera driver attached to camera %d\n",
icd->devnum);
Expand All @@ -458,8 +455,7 @@ static int mx1_camera_add_device(struct soc_camera_device *icd)

pcdev->icd = icd;

ebusy:
return ret;
return 0;
}

static void mx1_camera_remove_device(struct soc_camera_device *icd)
Expand Down

0 comments on commit 258c056

Please sign in to comment.