From: Antti Palosaari <crope@iki.fi>
To: Dan Carpenter <dan.carpenter@oracle.com>
Cc: Mauro Carvalho Chehab <m.chehab@samsung.com>,
linux-media@vger.kernel.org, kernel-janitors@vger.kernel.org
Subject: Re: [patch] [media] af9035: unlock on error in af9035_i2c_master_xfer()
Date: Fri, 22 Nov 2013 14:11:27 +0000 [thread overview]
Message-ID: <528F660F.9050100@iki.fi> (raw)
In-Reply-To: <20131122075045.GA15726@elgon.mountain>
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/
WARNING: multiple messages have this Message-ID (diff)
From: Antti Palosaari <crope@iki.fi>
To: Dan Carpenter <dan.carpenter@oracle.com>
Cc: Mauro Carvalho Chehab <m.chehab@samsung.com>,
linux-media@vger.kernel.org, kernel-janitors@vger.kernel.org
Subject: Re: [patch] [media] af9035: unlock on error in af9035_i2c_master_xfer()
Date: Fri, 22 Nov 2013 16:11:27 +0200 [thread overview]
Message-ID: <528F660F.9050100@iki.fi> (raw)
In-Reply-To: <20131122075045.GA15726@elgon.mountain>
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/
next prev parent reply other threads:[~2013-11-22 14:11 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-11-22 7:50 [patch] [media] af9035: unlock on error in af9035_i2c_master_xfer() Dan Carpenter
2013-11-22 7:50 ` Dan Carpenter
2013-11-22 14:11 ` Antti Palosaari [this message]
2013-11-22 14:11 ` Antti Palosaari
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=528F660F.9050100@iki.fi \
--to=crope@iki.fi \
--cc=dan.carpenter@oracle.com \
--cc=kernel-janitors@vger.kernel.org \
--cc=linux-media@vger.kernel.org \
--cc=m.chehab@samsung.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.