From 9c56cbf9aadff79c25ccd424ae422971efd5c1a4 Mon Sep 17 00:00:00 2001 From: Michael Grzeschik Date: Tue, 12 Jul 2011 12:39:03 -0300 Subject: [PATCH] [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 --- drivers/media/video/mt9m111.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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, -- 2.20.1