From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.8 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 4E92DC433E6 for ; Wed, 10 Feb 2021 19:09:06 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 2820964E66 for ; Wed, 10 Feb 2021 19:09:06 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234491AbhBJTIy (ORCPT ); Wed, 10 Feb 2021 14:08:54 -0500 Received: from youngberry.canonical.com ([91.189.89.112]:53433 "EHLO youngberry.canonical.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233117AbhBJTIh (ORCPT ); Wed, 10 Feb 2021 14:08:37 -0500 Received: from 1.general.cking.uk.vpn ([10.172.193.212] helo=localhost) by youngberry.canonical.com with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.86_2) (envelope-from ) id 1l9uq9-0000HE-1u; Wed, 10 Feb 2021 19:07:53 +0000 From: Colin King To: "Paul J . Murphy" , Daniele Alessandrelli , Mauro Carvalho Chehab , Sakari Ailus , Martina Krasteva , Gjorgji Rosikopulos , linux-media@vger.kernel.org Cc: kernel-janitors@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH][next] media: i2c: imx334: Fix a read of the uninitialized variable ret Date: Wed, 10 Feb 2021 19:07:52 +0000 Message-Id: <20210210190752.146631-1-colin.king@canonical.com> X-Mailer: git-send-email 2.30.0 MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Colin Ian King Currently there is a dev_err error message that is printing the error status in variable ret (that has not been set) instead of the correct error status from imx334->reset_gpio. Fix this. Addresses-Coverity: ("Uninitialized scalar variable") Fixes: 9746b11715c3 ("media: i2c: Add imx334 camera sensor driver") Signed-off-by: Colin Ian King --- drivers/media/i2c/imx334.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/media/i2c/imx334.c b/drivers/media/i2c/imx334.c index 07e31bc2ef18..f8b1caf26c9b 100644 --- a/drivers/media/i2c/imx334.c +++ b/drivers/media/i2c/imx334.c @@ -790,7 +790,8 @@ static int imx334_parse_hw_config(struct imx334 *imx334) imx334->reset_gpio = devm_gpiod_get_optional(imx334->dev, "reset", GPIOD_OUT_LOW); if (IS_ERR(imx334->reset_gpio)) { - dev_err(imx334->dev, "failed to get reset gpio %d", ret); + dev_err(imx334->dev, "failed to get reset gpio %ld", + IS_ERR_VALUE(imx334->reset_gpio)); return PTR_ERR(imx334->reset_gpio); } -- 2.30.0