Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp896880rwb; Thu, 8 Dec 2022 04:29:44 -0800 (PST) X-Google-Smtp-Source: AA0mqf4CDlSA60yEaiKB7TnIuygTXGJCE5BMP4vuXG/mNhSfB9xirt1XtMJ2oSmYhV9e1f5LP4QD X-Received: by 2002:a05:6402:2a08:b0:461:5e99:a299 with SMTP id ey8-20020a0564022a0800b004615e99a299mr4859695edb.40.1670502584592; Thu, 08 Dec 2022 04:29:44 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1670502584; cv=none; d=google.com; s=arc-20160816; b=SYVgPRZ3WWt0vWxghaLAb4lC14IhzyPYGtSXmcl5AyYY+dBkLSDGJaSX0ayEEknMnO YuOpOmdc1yz+4/dfYFtcjZehzFPQxg4L68mXx4ExHQoosvbT263ir5tuoES55rVlvRxV NIAU+n3qjoXVVWAi29laNk5DEZi+XI0+WxBDoXLn4C77+c6YKC4c6rNeb4Dru5uivAqy 4n+hCKDUQyYGVPAgyoq6vqlY5A91Bg2UjhlcCY2Yc1aiermk/F6JHHmSgNb5V6yWxLta BUcNdkCIFOSa+jW9Eno/WpPHnellA7MD9Kja1biql3RtvcWzGgTbYx6z0SFyuqbaqVeO CaMg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=AdvPC73c9zwfkFT3idm11mKPKt/UTJmdPBrpsnJ9sEg=; b=nbAkHkjlXjujQP31EiOhvP52rEvKSm9POl6B+IjElWIyF/Nd+rSb3FJzUzmRPM/zYC HKvlyATGidfcKM1I0ucBsuT1JIytVNhjCPpr/WROACDZ04aw/RB9ybiILDOmYJILisVA mhdK0Ntt6W3cD1GhzCETvol5FEu9le7j9VKG53L0q8qldbiZJeQBHCjSdio3qGH4Y3uV HdLkAywaBu4Tx2poLsarOVZRYbdTi9JxofQbd1/7WOvOWt/BsPqbVtmpKErr/6BTVCIm ZVFH80LBYGzNWSf8zJGWI3kqgSfqjwNzOS3cwCe4Jw0OBNf36MCUEnxczsZnE7klBb8+ JhFA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@bootlin.com header.s=gm1 header.b=DtiFiffK; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=bootlin.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id hw19-20020a170907a0d300b00781dbee4273si13983518ejc.514.2022.12.08.04.29.27; Thu, 08 Dec 2022 04:29:44 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@bootlin.com header.s=gm1 header.b=DtiFiffK; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=bootlin.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229966AbiLHLt1 (ORCPT + 72 others); Thu, 8 Dec 2022 06:49:27 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40088 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229957AbiLHLsT (ORCPT ); Thu, 8 Dec 2022 06:48:19 -0500 Received: from relay1-d.mail.gandi.net (relay1-d.mail.gandi.net [217.70.183.193]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 039DC6F0E3; Thu, 8 Dec 2022 03:48:15 -0800 (PST) Received: (Authenticated sender: paul.kocialkowski@bootlin.com) by mail.gandi.net (Postfix) with ESMTPSA id D1A01240011; Thu, 8 Dec 2022 11:48:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=gm1; t=1670500094; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=AdvPC73c9zwfkFT3idm11mKPKt/UTJmdPBrpsnJ9sEg=; b=DtiFiffK3Z98ZaFmBXwerOQeFzge8eRkBWde/Pd1X3KqrPJKGWFDwDVKVtpGS/eiMk9/5E TorFM8o8IyCQ2MvECljMaTW6U1RFBqHCGt5BvVK9K9e+wf5gjJ229V2pcvZXTq5Od5r9kt ++SnRgVYIEetCpQ8n9mj0WIBH4LeCnWIFTtEaYBzk1crXGFjs5SO9a3xfIhVwS7SrcGgpi +GIXb573ZWdyHhxJAaaOkq4XYbEQaSFRBVxpEpG2ri7/vVRi/jvuGm16+v/dkNjPaLppf+ u/W+BheJsV1Jly/MvH57Vo5TpJCnNjX09LWFI5OckHEex8C/jIFh/54+N7l7tg== From: Paul Kocialkowski To: linux-media@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-sunxi@lists.linux.dev, linux-kernel@vger.kernel.org, linux-staging@lists.linux.dev Cc: Yong Deng , Paul Kocialkowski , Mauro Carvalho Chehab , Chen-Yu Tsai , Jernej Skrabec , Samuel Holland , Thomas Petazzoni , Hans Verkuil , Sakari Ailus Subject: [PATCH 7/9] media: sun6i-isp: bridge: Error out on invalid port to fix warning Date: Thu, 8 Dec 2022 12:47:40 +0100 Message-Id: <20221208114742.399461-8-paul.kocialkowski@bootlin.com> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20221208114742.399461-1-paul.kocialkowski@bootlin.com> References: <20221208114742.399461-1-paul.kocialkowski@bootlin.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The enabled variable is only set for a valid port and used later, which triggers an uninitialized use smatch warning. Explicitly error out in that case to fix the warning. Signed-off-by: Paul Kocialkowski --- drivers/staging/media/sunxi/sun6i-isp/sun6i_isp_proc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/staging/media/sunxi/sun6i-isp/sun6i_isp_proc.c b/drivers/staging/media/sunxi/sun6i-isp/sun6i_isp_proc.c index a95709d2c573..4f34c1bc8be9 100644 --- a/drivers/staging/media/sunxi/sun6i-isp/sun6i_isp_proc.c +++ b/drivers/staging/media/sunxi/sun6i-isp/sun6i_isp_proc.c @@ -416,7 +416,7 @@ static int sun6i_isp_proc_notifier_bound(struct v4l2_async_notifier *notifier, enabled = !proc->source_csi0.expected; break; default: - break; + return -EINVAL; } source->subdev = remote_subdev; -- 2.38.1