From patchwork Thu Dec 8 11:47:36 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paul Kocialkowski X-Patchwork-Id: 31315 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:f944:0:0:0:0:0 with SMTP id q4csp145714wrr; Thu, 8 Dec 2022 03:49:38 -0800 (PST) X-Google-Smtp-Source: AA0mqf7cG+6mIfzEjW6uz2UV8+dQp79xIXwOJTv+cfXamRWN3rGAsIhS9qXUk9dE4tP6EVPzusX1 X-Received: by 2002:a17:902:b093:b0:189:e687:b366 with SMTP id p19-20020a170902b09300b00189e687b366mr13241349plr.167.1670500177718; Thu, 08 Dec 2022 03:49:37 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1670500177; cv=none; d=google.com; s=arc-20160816; b=gsZNq6u/ijllOg67jLI7NzB0mYMlIJ2O8EAR0bvuzJsW0OQxGdPbgJCsN1uOA48wxi tQRfxHxbKMA+V1X9P9ltYhKqPPzQFBcR7UW1UFneGnYQaMEQ/Mmq3xovJ0QE27Qmysv0 jijnwWcb5tdFFRHyW1YsQQRdu2/I5zSugjwI/mhx2vH1/eh3tIH/s5L+/JYOP3uWwKuW Grhv6376SOzfsOMyf+kWoFyuHimWVOrO4R+PGUemF3Bznct72o19Ut3/XhlIcRauuVYB rZiWiKwi0pCe4PldVMWk2byil0h+SRUt+0J1sLdCOgJLgXiCtNJnoyB1O4oEfX1rPid0 e+NQ== 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=G6S8oJ3aFtNCcZoU3kaxCoOFZa8bIBnBoUJ/ngEwAfA=; b=bBWoU1gvKP52DvTD6+kCJbjnz/n4YeNOcJ/iD2Ioix37AqTgNbUDzzzV+9SmVRTDRx 7GoidHjQAlzM0qpkkPecMU6z8mW8LBY4TN6dUzI0yNaarMk70mYW7UPG/9r1K09AYSNP d9Rjk3SBbLs0uQB9U79UC3rrevUKGHq/c8qtQ65D1zIsDsddch3Bt8TXP/xCjZfYVYDe 1N0AjkY6YElbx4W7NrOkbv443f77bg0QEr7eGVrgKomK0OVRd7aYh6z+RtHlOeOIeoOq wihYz5trSiYRcTRxhg/xUghfg+tgvh0kGEHXydfbFHP/y8KFYqdrzuEtC6O7qFpAYOhh /njw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@bootlin.com header.s=gm1 header.b=dUWD1ZGv; 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: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id lw8-20020a17090b180800b0021a0d65730esi4643218pjb.166.2022.12.08.03.49.24; Thu, 08 Dec 2022 03:49:37 -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=dUWD1ZGv; 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 S229978AbiLHLs1 (ORCPT + 99 others); Thu, 8 Dec 2022 06:48:27 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39944 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229868AbiLHLsP (ORCPT ); Thu, 8 Dec 2022 06:48:15 -0500 Received: from relay1-d.mail.gandi.net (relay1-d.mail.gandi.net [IPv6:2001:4b98:dc4:8::221]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C2CF184DDC; Thu, 8 Dec 2022 03:48:08 -0800 (PST) Received: (Authenticated sender: paul.kocialkowski@bootlin.com) by mail.gandi.net (Postfix) with ESMTPSA id 4523B24000F; Thu, 8 Dec 2022 11:48:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=gm1; t=1670500087; 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=G6S8oJ3aFtNCcZoU3kaxCoOFZa8bIBnBoUJ/ngEwAfA=; b=dUWD1ZGv9IFpByixdjm7gJRgcw5SjjHfkd6ABN3i8v5wYathBEODJDb0Tms3YqwJUPLlRF tGP8LlqVTbFp4iykF4Cx9VkPdKLr3eSzR9Jy/plnGlEN1ZF0W883+/HEdPPWa+PmNMlujP D1i/wBPeZpKni3KK+1mPH1vKaX3Y9BfBtWLx+Xy7rfRqdTqwSaj9Mg3KM+OdC8F3LSnxYZ XzAiJGPOsVdL3GvomGO2wmIHvu9FoQqXwraQrx84Ez12QB1bythbGFxMQJwTdWfAj0TrSV N9NEpX40Ilc0J55PCC1PoOxkkWurcxbc+GCCqLdKTRGpa+iv4naZdnbnOFOYcQ== 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 3/9] media: sun6i-csi: bridge: Error out on invalid port to fix warning Date: Thu, 8 Dec 2022 12:47:36 +0100 Message-Id: <20221208114742.399461-4-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 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 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1751646394432359686?= X-GMAIL-MSGID: =?utf-8?q?1751646394432359686?= 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/media/platform/sunxi/sun6i-csi/sun6i_csi_bridge.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/media/platform/sunxi/sun6i-csi/sun6i_csi_bridge.c b/drivers/media/platform/sunxi/sun6i-csi/sun6i_csi_bridge.c index 88df3a73ebfa..4517c0346eef 100644 --- a/drivers/media/platform/sunxi/sun6i-csi/sun6i_csi_bridge.c +++ b/drivers/media/platform/sunxi/sun6i-csi/sun6i_csi_bridge.c @@ -663,7 +663,7 @@ sun6i_csi_bridge_notifier_bound(struct v4l2_async_notifier *notifier, enabled = !bridge->source_parallel.expected; break; default: - break; + return -EINVAL; } source->subdev = remote_subdev;