Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp1065030rwb; Thu, 8 Dec 2022 06:24:33 -0800 (PST) X-Google-Smtp-Source: AA0mqf5TFpqbti/ylvh91sbjxp+kfOnD7vvw+aZ8b+b7gSbaIOLg2N2CLHyQ1dvtm8eiaOro9E/p X-Received: by 2002:a05:6a00:1c8d:b0:56c:f87e:c662 with SMTP id y13-20020a056a001c8d00b0056cf87ec662mr78921434pfw.65.1670509472895; Thu, 08 Dec 2022 06:24:32 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1670509472; cv=none; d=google.com; s=arc-20160816; b=xdcuTA/OqvF2ehXyQrVAHjOHHbvAQZ/oJW3Kk0nXKWezifvPS3zXqSapZ2xwsIhV4C D+CzwZAiGWM7qCdcRx75y8ryFLAi+MDoCti53Ao/3z0eQEu+7+c4YWu22RxgmVDYTDOa Oc/ko/XWc15AEE7rCMQhGkCv/yFe0jCgLJlfhfE8j4N6hpvfrdYm9S2loKxvZlXNPVaQ /3lnzHp5kzJ1KJnzMzlaIs9tIuOhMhQL+lOaNo+7COcjvZIcaCelrLaWMwBX6yqYhkHG q4op1CFvn8hl9ALmyZYNowVtO1+sDpaw46vTWezY3kCZKqCdj27Gz4JInZeDkb1kKPl8 NqhA== 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=LSzyeFFbgISZ/XcjaB38QewnBAIka+71vdPWj8SCHL4=; b=jjLx4cvxsqoQkSwOjW8zmRtXq0COx+dAppDBRP4bpble++QXiitmsQBg3wpOm/MS6x hL9lSvc8iDxCR769XenTFgQyg1ov3T+mjmbqiZ4x9Gb10PmfUttqu1HRib4fAM4Z4AX3 7enaHJRPAKthBc6ABCckVoefGS71mAv4Zh0AmcKJcZLXZlxQ81Xw/dC6iDt43ola0JZP Gi6sJ8bE8A0tCc2hJnLsaDni2Efm0qZJEQkpe7h3Z76UnL6hSxIVgGxkhHoE+H4Em111 kK3vIDSwlk57k1EJjqXeZ1L+twZUHlMHa+QDl9SqCNj10/PpoafHha5y8vsOZNotIqvH wdqw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@bootlin.com header.s=gm1 header.b="KVYG/tL1"; 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 199-20020a6303d0000000b00477c3c222b6si23640003pgd.685.2022.12.08.06.24.21; Thu, 08 Dec 2022 06:24:32 -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="KVYG/tL1"; 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 S230158AbiLHOVW (ORCPT + 73 others); Thu, 8 Dec 2022 09:21:22 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49252 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230037AbiLHOU4 (ORCPT ); Thu, 8 Dec 2022 09:20:56 -0500 Received: from relay6-d.mail.gandi.net (relay6-d.mail.gandi.net [217.70.183.198]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4F35094903; Thu, 8 Dec 2022 06:20:45 -0800 (PST) Received: (Authenticated sender: paul.kocialkowski@bootlin.com) by mail.gandi.net (Postfix) with ESMTPSA id 1F653C0007; Thu, 8 Dec 2022 14:20:42 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=gm1; t=1670509243; 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=LSzyeFFbgISZ/XcjaB38QewnBAIka+71vdPWj8SCHL4=; b=KVYG/tL1bPMselEeCN3b/I8Qw9g0WjPv/m2OQgIDTADcDDbRBVA0NAVDoSgyNeerL9ZFzs nFPWKVmw/4LeuyIPCj4Bx6J6pl0Zpsh6H++NIytcZTPBnLeKEUmU5yoogJeFL6CHFEhh+l kZGPQVCEsETlHo009nT/W5tpUgOTvwlE+GuCyUWowYMfpK2LaqEgIQ2GlGtGk3yd9zPQoB ilGh4D/ZOHRWMtB7aHKtvPZqdLQrEt8+I7WJY0hRVhbe2CBuLK5wmUI4aDjHz8V4HWRnj0 G4NI8K4vHuwe6JmEvn3UrsSvfwwFywW6ih7n74Acr9g2OaOVXIumq3tUPo+LCg== 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 v3 08/12] media: sun6i-isp: proc: Error out on invalid port to fix warning Date: Thu, 8 Dec 2022 15:20:02 +0100 Message-Id: <20221208142006.425809-9-paul.kocialkowski@bootlin.com> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20221208142006.425809-1-paul.kocialkowski@bootlin.com> References: <20221208142006.425809-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 Fixes: e3185e1d7c14 ("media: staging: media: Add support for the Allwinner A31 ISP") --- 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