From patchwork Tue Jul 12 15:39:03 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Grzeschik X-Patchwork-Id: 968672 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter1.kernel.org (8.14.4/8.14.4) with ESMTP id p6CFdBW0002277 for ; Tue, 12 Jul 2011 15:39:11 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753840Ab1GLPjI (ORCPT ); Tue, 12 Jul 2011 11:39:08 -0400 Received: from metis.ext.pengutronix.de ([92.198.50.35]:39110 "EHLO metis.ext.pengutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753739Ab1GLPjH (ORCPT ); Tue, 12 Jul 2011 11:39:07 -0400 Received: from octopus.hi.pengutronix.de ([2001:6f8:1178:2:215:17ff:fe12:23b0]) by metis.ext.pengutronix.de with esmtp (Exim 4.72) (envelope-from ) id 1Qgf3C-0006W3-Kf; Tue, 12 Jul 2011 17:39:06 +0200 Received: from mgr by octopus.hi.pengutronix.de with local (Exim 4.76) (envelope-from ) id 1Qgf3C-0005PG-EV; Tue, 12 Jul 2011 17:39:06 +0200 From: Michael Grzeschik To: linux-media@vger.kernel.org Cc: g.liakhovetski@gmx.de, Michael Grzeschik Subject: [PATCH 2/5] mt9m111: fix missing return value check mt9m111_reg_clear Date: Tue, 12 Jul 2011 17:39:03 +0200 Message-Id: <1310485146-27759-2-git-send-email-m.grzeschik@pengutronix.de> X-Mailer: git-send-email 1.7.5.4 In-Reply-To: <1310485146-27759-1-git-send-email-m.grzeschik@pengutronix.de> References: <1310485146-27759-1-git-send-email-m.grzeschik@pengutronix.de> X-SA-Exim-Connect-IP: 2001:6f8:1178:2:215:17ff:fe12:23b0 X-SA-Exim-Mail-From: mgr@pengutronix.de X-SA-Exim-Scanned: No (on metis.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-media@vger.kernel.org Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.6 (demeter1.kernel.org [140.211.167.41]); Tue, 12 Jul 2011 15:39:11 +0000 (UTC) Signed-off-by: Michael Grzeschik --- drivers/media/video/mt9m111.c | 4 +++- 1 files changed, 3 insertions(+), 1 deletions(-) diff --git a/drivers/media/video/mt9m111.c b/drivers/media/video/mt9m111.c index f10dcf0..e08b46c 100644 --- a/drivers/media/video/mt9m111.c +++ b/drivers/media/video/mt9m111.c @@ -248,7 +248,9 @@ static int mt9m111_reg_clear(struct i2c_client *client, const u16 reg, int ret = 0; 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 i2c_client *client,