From patchwork Fri Nov 18 17:49:15 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christophe JAILLET X-Patchwork-Id: 9437169 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id B727F60469 for ; Fri, 18 Nov 2016 17:49:48 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id AF1E5299BF for ; Fri, 18 Nov 2016 17:49:48 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id A1D8C299C3; Fri, 18 Nov 2016 17:49:48 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.4 required=2.0 tests=BAYES_00,FREEMAIL_FROM, RCVD_IN_DNSWL_HI,RCVD_IN_SORBS_SPAM autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 25662299BF for ; Fri, 18 Nov 2016 17:49:48 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753776AbcKRRta (ORCPT ); Fri, 18 Nov 2016 12:49:30 -0500 Received: from smtp09.smtpout.orange.fr ([80.12.242.131]:22236 "EHLO smtp.smtpout.orange.fr" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752785AbcKRRt3 (ORCPT ); Fri, 18 Nov 2016 12:49:29 -0500 Received: from localhost.localdomain ([92.140.172.136]) by mwinf5d69 with ME id 9VpK1u01t2wvn5003VpL2P; Fri, 18 Nov 2016 18:49:26 +0100 X-ME-Helo: localhost.localdomain X-ME-Auth: Y2hyaXN0b3BoZS5qYWlsbGV0QHdhbmFkb28uZnI= X-ME-Date: Fri, 18 Nov 2016 18:49:26 +0100 X-ME-IP: 92.140.172.136 From: Christophe JAILLET To: g.liakhovetski@gmx.de, mchehab@kernel.org Cc: linux-media@vger.kernel.org, linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org, Christophe JAILLET Subject: [PATCH] [media] soc-camera: Fix a return value in case of error Date: Fri, 18 Nov 2016 18:49:15 +0100 Message-Id: <20161118174915.8072-1-christophe.jaillet@wanadoo.fr> X-Mailer: git-send-email 2.9.3 X-Antivirus: avast! (VPS 161118-0, 18/11/2016), Outbound message X-Antivirus-Status: Clean Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP If 'ov9640_reg_read()' does not return 0, then 'val' is left unmodified. As it is not initialized either, the return value can be anything. It is likely that returning the error code was expected here. Signed-off-by: Christophe JAILLET --- drivers/media/i2c/soc_camera/ov9640.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/media/i2c/soc_camera/ov9640.c b/drivers/media/i2c/soc_camera/ov9640.c index 8c93c57af71c..65085a235128 100644 --- a/drivers/media/i2c/soc_camera/ov9640.c +++ b/drivers/media/i2c/soc_camera/ov9640.c @@ -233,7 +233,7 @@ static int ov9640_reg_rmw(struct i2c_client *client, u8 reg, u8 set, u8 unset) if (ret) { dev_err(&client->dev, "[Read]-Modify-Write of register %02x failed!\n", reg); - return val; + return ret; } val |= set;