diff options
author | Andre Bartke <andre.bartke@gmail.com> | 2011-06-10 06:57:54 -0400 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2011-07-01 14:51:34 -0400 |
commit | 258c05637d6b6df2478a2808a3d2350c3c6782d6 (patch) | |
tree | de8712eccba08ddb0c1c3622e5fcd977946a1551 | |
parent | 383e4f69879d11c86ebdd38b3356f6d0690fb4cc (diff) |
[media] V4L: mx1-camera: fix uninitialized variable
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>
-rw-r--r-- | drivers/media/video/mx1_camera.c | 10 |
1 files changed, 3 insertions, 7 deletions
diff --git a/drivers/media/video/mx1_camera.c b/drivers/media/video/mx1_camera.c index bc0c23a1009c..63f8a0cc33d8 100644 --- a/drivers/media/video/mx1_camera.c +++ b/drivers/media/video/mx1_camera.c | |||
@@ -444,12 +444,9 @@ static int mx1_camera_add_device(struct soc_camera_device *icd) | |||
444 | { | 444 | { |
445 | struct soc_camera_host *ici = to_soc_camera_host(icd->dev.parent); | 445 | struct soc_camera_host *ici = to_soc_camera_host(icd->dev.parent); |
446 | struct mx1_camera_dev *pcdev = ici->priv; | 446 | struct mx1_camera_dev *pcdev = ici->priv; |
447 | int ret; | ||
448 | 447 | ||
449 | if (pcdev->icd) { | 448 | if (pcdev->icd) |
450 | ret = -EBUSY; | 449 | return -EBUSY; |
451 | goto ebusy; | ||
452 | } | ||
453 | 450 | ||
454 | dev_info(icd->dev.parent, "MX1 Camera driver attached to camera %d\n", | 451 | dev_info(icd->dev.parent, "MX1 Camera driver attached to camera %d\n", |
455 | icd->devnum); | 452 | icd->devnum); |
@@ -458,8 +455,7 @@ static int mx1_camera_add_device(struct soc_camera_device *icd) | |||
458 | 455 | ||
459 | pcdev->icd = icd; | 456 | pcdev->icd = icd; |
460 | 457 | ||
461 | ebusy: | 458 | return 0; |
462 | return ret; | ||
463 | } | 459 | } |
464 | 460 | ||
465 | static void mx1_camera_remove_device(struct soc_camera_device *icd) | 461 | static void mx1_camera_remove_device(struct soc_camera_device *icd) |