From patchwork Fri Oct 6 10:08:49 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hans Verkuil X-Patchwork-Id: 13411248 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 9AB9BE92FFF for ; Fri, 6 Oct 2023 10:09:09 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231705AbjJFKJI (ORCPT ); Fri, 6 Oct 2023 06:09:08 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37632 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231663AbjJFKJF (ORCPT ); Fri, 6 Oct 2023 06:09:05 -0400 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8865CFD for ; Fri, 6 Oct 2023 03:09:04 -0700 (PDT) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 2BD5BC433D9; Fri, 6 Oct 2023 10:09:02 +0000 (UTC) From: Hans Verkuil To: linux-media@vger.kernel.org Cc: Hans Verkuil , Laurent Pinchart Subject: [PATCH 8/9] media: i2c: mt9m114: goto proper error path Date: Fri, 6 Oct 2023 12:08:49 +0200 Message-Id: <6e2b3d5971905c1cf63184e7c3cd269c10151bb7.1696586632.git.hverkuil-cisco@xs4all.nl> X-Mailer: git-send-email 2.40.1 In-Reply-To: References: MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org In two places the probe function returns instead of going to the correct goto label. This fixes this smatch warning: drivers/media/i2c/mt9m114.c:2381 mt9m114_probe() warn: missing unwind goto? Signed-off-by: Hans Verkuil CC: Laurent Pinchart --- drivers/media/i2c/mt9m114.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/media/i2c/mt9m114.c b/drivers/media/i2c/mt9m114.c index dae675e52390..ac19078ceda3 100644 --- a/drivers/media/i2c/mt9m114.c +++ b/drivers/media/i2c/mt9m114.c @@ -2367,7 +2367,7 @@ static int mt9m114_probe(struct i2c_client *client) ret = mt9m114_clk_init(sensor); if (ret) - return ret; + goto error_ep_free; /* * Identify the sensor. The driver supports runtime PM, but needs to @@ -2378,7 +2378,7 @@ static int mt9m114_probe(struct i2c_client *client) ret = mt9m114_power_on(sensor); if (ret < 0) { dev_err_probe(dev, ret, "Could not power on the device\n"); - return ret; + goto error_ep_free; } ret = mt9m114_identify(sensor);