From: Michael Grzeschik Date: Tue, 12 Jul 2011 15:39:03 +0000 (-0300) Subject: [media] V4L: mt9m111: fix missing return value check mt9m111_reg_clear X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=9c56cbf9aadff79c25ccd424ae422971efd5c1a4;p=linux-beck.git [media] V4L: mt9m111: fix missing return value check mt9m111_reg_clear Signed-off-by: Michael Grzeschik Signed-off-by: Guennadi Liakhovetski Signed-off-by: Mauro Carvalho Chehab --- diff --git a/drivers/media/video/mt9m111.c b/drivers/media/video/mt9m111.c index cbccc869c7e1..8d8420acc9cf 100644 --- a/drivers/media/video/mt9m111.c +++ b/drivers/media/video/mt9m111.c @@ -250,7 +250,9 @@ static int mt9m111_reg_clear(struct i2c_client *client, const u16 reg, int ret; ret = mt9m111_reg_read(client, reg); - return mt9m111_reg_write(client, reg, ret & ~data); + if (ret >= 0) + ret = mt9m111_reg_write(client, reg, ret & ~data); + return ret; } static int mt9m111_set_context(struct mt9m111 *mt9m111,