提交 c80296d7 编写于 作者: R Roel Kluin 提交者: Mauro Carvalho Chehab

V4L/DVB (6564): Move check before lock

Signed-off-by: NRoel Kluin <12o3l@tiscali.nl>
Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
CC: Antti Palosaari <crope@iki.fi>
CC: Carl Lundqvist <comabug@gmail.com>
CC: Aapo Tahkola <aet@rasterburn.org>
Signed-off-by: NMauro Carvalho Chehab <mchehab@infradead.org>
上级 bbe1e0ba
......@@ -79,12 +79,12 @@ static int au6610_i2c_xfer(struct i2c_adapter *adap, struct i2c_msg msg[],
struct dvb_usb_device *d = i2c_get_adapdata(adap);
int i;
if (mutex_lock_interruptible(&d->i2c_mutex) < 0)
return -EAGAIN;
if (num > 2)
return -EINVAL;
if (mutex_lock_interruptible(&d->i2c_mutex) < 0)
return -EAGAIN;
for (i = 0; i < num; i++) {
/* write/read request */
if (i+1 < num && (msg[i+1].flags & I2C_M_RD)) {
......
......@@ -56,12 +56,12 @@ static int gl861_i2c_xfer(struct i2c_adapter *adap, struct i2c_msg msg[],
struct dvb_usb_device *d = i2c_get_adapdata(adap);
int i;
if (mutex_lock_interruptible(&d->i2c_mutex) < 0)
return -EAGAIN;
if (num > 2)
return -EINVAL;
if (mutex_lock_interruptible(&d->i2c_mutex) < 0)
return -EAGAIN;
for (i = 0; i < num; i++) {
/* write/read request */
if (i+1 < num && (msg[i+1].flags & I2C_M_RD)) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册