Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp1059922rwb; Thu, 8 Dec 2022 06:21:01 -0800 (PST) X-Google-Smtp-Source: AA0mqf67FPXCN+NxdutCB3Vjcx+i9H97ri5v6GdTTv7eflxBhrvorcn4NQWRCJT88WJ8aN2gaqr3 X-Received: by 2002:a63:4964:0:b0:478:9e30:e2b8 with SMTP id y36-20020a634964000000b004789e30e2b8mr20517841pgk.312.1670509261349; Thu, 08 Dec 2022 06:21:01 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1670509261; cv=none; d=google.com; s=arc-20160816; b=h5eR9zz5SCDgv0rLu/HJhdIxzmx7XAKm8ZbMbcI1FKo/5ThlBH91Cblsxymv+twM3x 6zqRUY8UILvA96tXRzS+pt+5yKzu6AxNr/W0IgdtnmRxarTmzA/5siCFNvWTWh6CrPGC i+kT4fI58yOlvZRWIUndgIeuYWWtzjjLsEkddzu9W0AOI5C72fWvE/ED/vl1MkVruds7 ioPst5h5GCeBdZLMrmn5wQo9hLVB/Ra7PYijg2DuKLDRP6v0H89x9ZER6kY/d1Acv1Gm LV+53BMS63YXt5GhUP6/lMAtZShqLxOt5sBtBPNz98pFw/UIys+fpqXbP5i6WNPPd1Hv UK8w== 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=dLhVXFTW8WraaMbyVDY9MK5lco8UR50ZLJJYfD+2aNlGZ3AznbQNA3tuwspmow0gSl dEj9Z9q/3d566gd/LAQSlopq/OEmWN0MYS8UeaQv+hsz3MrhPTktzEH01ijmWQtzcOo0 nMuTdpVkTYH4+hd50+EqsGu67rpglgV3wcRemqXl01YeA3geCYttx5muA0mSRQZpiqFf AtKUIUwV1yWK2EOxECoeUjyLaKPNcaWS2FARg73VtrkLy3TLyYJfHKggLdKTEJU0ILP5 BOE9+O7Ycf1uZ9ur2vtqgsBUl/QGwm3mfIEMc4NPpF63PFSlg58W3JF24bQG4Tj9OKz4 qnXw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@bootlin.com header.s=gm1 header.b=TIxJ12w9; 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 u18-20020a17090341d200b00188ef298718si25335456ple.351.2022.12.08.06.20.52; Thu, 08 Dec 2022 06:21:01 -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=TIxJ12w9; 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 S230366AbiLHN5E (ORCPT + 72 others); Thu, 8 Dec 2022 08:57:04 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60436 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229738AbiLHN4n (ORCPT ); Thu, 8 Dec 2022 08:56:43 -0500 Received: from relay7-d.mail.gandi.net (relay7-d.mail.gandi.net [IPv6:2001:4b98:dc4:8::227]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 14A5798EAF; Thu, 8 Dec 2022 05:56:15 -0800 (PST) Received: (Authenticated sender: paul.kocialkowski@bootlin.com) by mail.gandi.net (Postfix) with ESMTPSA id 91DF020009; Thu, 8 Dec 2022 13:55:52 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=gm1; t=1670507754; 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=TIxJ12w9hxF1f1ILrsC/djK5bLsm10CyMS3jQyEac4kVdwvBxxnbVS+zqX3kvdkL+O8Zlp 7NIXFgJuyytOlji5Rr+NmY9K6w+ka/j4foYOkmQZPGdzU3C+NbymUZog270rxjIwXzI26C jK98kHLK+JoIG6VycBrr7W+lQjB4q/ZwgIKL8NGIefTx9/1T6WbyCqOjDZxG5td7DGN+uL ybKFppsHo4GM+v9SlLQa4cR3uEAzQ3g8qRZDc/hf2+POG08Hryd0MHf52pNiIzu7ZXczuE 8h2yNxIgukfm9v3pMamq+h5rEZEnB+itvAXiWoHlDgN/vcPg8OVbxGzVFOOZ/A== 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 , Conor Dooley , Nathan Chancellor Subject: [PATCH v2 08/11] media: sun6i-isp: proc: Error out on invalid port to fix warning Date: Thu, 8 Dec 2022 14:55:09 +0100 Message-Id: <20221208135512.421903-9-paul.kocialkowski@bootlin.com> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20221208135512.421903-1-paul.kocialkowski@bootlin.com> References: <20221208135512.421903-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,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