diff mbox

drivers/media: fix uninitialized variable

Message ID 1307121721-6658-1-git-send-email-andre.bartke@gmail.com (mailing list archive)
State Accepted
Headers show

Commit Message

Andre Bartke June 3, 2011, 5:22 p.m. UTC
mx1_camera_add_device() can return an
uninitialized value of ret.

Signed-off-by: Andre Bartke <andre.bartke@gmail.com>
---
 drivers/media/video/mx1_camera.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

Comments

Guennadi Liakhovetski June 3, 2011, 6:16 p.m. UTC | #1
On Fri, 3 Jun 2011, Andre Bartke wrote:

> mx1_camera_add_device() can return an
> uninitialized value of ret.
> 
> Signed-off-by: Andre Bartke <andre.bartke@gmail.com>

Thanks, will push to 3.0

Guennadi

> ---
>  drivers/media/video/mx1_camera.c |    2 +-
>  1 files changed, 1 insertions(+), 1 deletions(-)
> 
> diff --git a/drivers/media/video/mx1_camera.c b/drivers/media/video/mx1_camera.c
> index bc0c23a..d9fc4b2 100644
> --- a/drivers/media/video/mx1_camera.c
> +++ b/drivers/media/video/mx1_camera.c
> @@ -444,7 +444,7 @@ 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;
> +	int ret = 0;
>  
>  	if (pcdev->icd) {
>  		ret = -EBUSY;
> -- 
> 1.7.5.2
> 
> --
> To unsubscribe from this list: send the line "unsubscribe linux-media" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> 

---
Guennadi Liakhovetski, Ph.D.
Freelance Open-Source Software Developer
http://www.open-technology.de/
--
To unsubscribe from this list: send the line "unsubscribe linux-media" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/drivers/media/video/mx1_camera.c b/drivers/media/video/mx1_camera.c
index bc0c23a..d9fc4b2 100644
--- a/drivers/media/video/mx1_camera.c
+++ b/drivers/media/video/mx1_camera.c
@@ -444,7 +444,7 @@  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;
+	int ret = 0;
 
 	if (pcdev->icd) {
 		ret = -EBUSY;