kernel-janitors.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [patch] [media] af9035: unlock on error in af9035_i2c_master_xfer()
@ 2013-11-22  7:50 Dan Carpenter
  2013-11-22 14:11 ` Antti Palosaari
  0 siblings, 1 reply; 2+ messages in thread
From: Dan Carpenter @ 2013-11-22  7:50 UTC (permalink / raw)
  To: Antti Palosaari; +Cc: Mauro Carvalho Chehab, linux-media, kernel-janitors

We introduced a couple new error paths which are missing unlocks.

Fixes: 7760e148350b ('[media] af9035: Don't use dynamic static allocation')
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>

diff --git a/drivers/media/usb/dvb-usb-v2/af9035.c b/drivers/media/usb/dvb-usb-v2/af9035.c
index c8fcd78425bd..625ef2489b23 100644
--- a/drivers/media/usb/dvb-usb-v2/af9035.c
+++ b/drivers/media/usb/dvb-usb-v2/af9035.c
@@ -245,7 +245,8 @@ static int af9035_i2c_master_xfer(struct i2c_adapter *adap,
 				dev_warn(&d->udev->dev,
 					 "%s: i2c xfer: len=%d is too big!\n",
 					 KBUILD_MODNAME, msg[0].len);
-				return -EOPNOTSUPP;
+				ret = -EOPNOTSUPP;
+				goto unlock;
 			}
 			req.mbox |= ((msg[0].addr & 0x80)  >>  3);
 			buf[0] = msg[1].len;
@@ -281,7 +282,8 @@ static int af9035_i2c_master_xfer(struct i2c_adapter *adap,
 				dev_warn(&d->udev->dev,
 					 "%s: i2c xfer: len=%d is too big!\n",
 					 KBUILD_MODNAME, msg[0].len);
-				return -EOPNOTSUPP;
+				ret = -EOPNOTSUPP;
+				goto unlock;
 			}
 			req.mbox |= ((msg[0].addr & 0x80)  >>  3);
 			buf[0] = msg[0].len;
@@ -319,6 +321,7 @@ static int af9035_i2c_master_xfer(struct i2c_adapter *adap,
 		ret = -EOPNOTSUPP;
 	}
 
+unlock:
 	mutex_unlock(&d->i2c_mutex);
 
 	if (ret < 0)

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [patch] [media] af9035: unlock on error in af9035_i2c_master_xfer()
  2013-11-22  7:50 [patch] [media] af9035: unlock on error in af9035_i2c_master_xfer() Dan Carpenter
@ 2013-11-22 14:11 ` Antti Palosaari
  0 siblings, 0 replies; 2+ messages in thread
From: Antti Palosaari @ 2013-11-22 14:11 UTC (permalink / raw)
  To: Dan Carpenter; +Cc: Mauro Carvalho Chehab, linux-media, kernel-janitors

Acked-by: Antti Palosaari <crope@iki.fi>

Antti

On 22.11.2013 09:50, Dan Carpenter wrote:
> We introduced a couple new error paths which are missing unlocks.
>
> Fixes: 7760e148350b ('[media] af9035: Don't use dynamic static allocation')
> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
>
> diff --git a/drivers/media/usb/dvb-usb-v2/af9035.c b/drivers/media/usb/dvb-usb-v2/af9035.c
> index c8fcd78425bd..625ef2489b23 100644
> --- a/drivers/media/usb/dvb-usb-v2/af9035.c
> +++ b/drivers/media/usb/dvb-usb-v2/af9035.c
> @@ -245,7 +245,8 @@ static int af9035_i2c_master_xfer(struct i2c_adapter *adap,
>   				dev_warn(&d->udev->dev,
>   					 "%s: i2c xfer: len=%d is too big!\n",
>   					 KBUILD_MODNAME, msg[0].len);
> -				return -EOPNOTSUPP;
> +				ret = -EOPNOTSUPP;
> +				goto unlock;
>   			}
>   			req.mbox |= ((msg[0].addr & 0x80)  >>  3);
>   			buf[0] = msg[1].len;
> @@ -281,7 +282,8 @@ static int af9035_i2c_master_xfer(struct i2c_adapter *adap,
>   				dev_warn(&d->udev->dev,
>   					 "%s: i2c xfer: len=%d is too big!\n",
>   					 KBUILD_MODNAME, msg[0].len);
> -				return -EOPNOTSUPP;
> +				ret = -EOPNOTSUPP;
> +				goto unlock;
>   			}
>   			req.mbox |= ((msg[0].addr & 0x80)  >>  3);
>   			buf[0] = msg[0].len;
> @@ -319,6 +321,7 @@ static int af9035_i2c_master_xfer(struct i2c_adapter *adap,
>   		ret = -EOPNOTSUPP;
>   	}
>
> +unlock:
>   	mutex_unlock(&d->i2c_mutex);
>
>   	if (ret < 0)
>


-- 
http://palosaari.fi/

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2013-11-22 14:11 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-11-22  7:50 [patch] [media] af9035: unlock on error in af9035_i2c_master_xfer() Dan Carpenter
2013-11-22 14:11 ` Antti Palosaari

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).