Received: by 2002:a05:6a10:413:0:0:0:0 with SMTP id 19csp326778pxp; Wed, 9 Mar 2022 03:54:12 -0800 (PST) X-Google-Smtp-Source: ABdhPJxRti+48AO7TIR9V6hThKBVs8/huIYIJHKkRXH+/yMcBwkUW1GJSwDMFe2M1hLMMDT19zoz X-Received: by 2002:a17:90b:4d88:b0:1bf:793:7134 with SMTP id oj8-20020a17090b4d8800b001bf07937134mr9994878pjb.112.1646826852111; Wed, 09 Mar 2022 03:54:12 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1646826852; cv=none; d=google.com; s=arc-20160816; b=jNnfQYSY+z1OwJq+Jcq9Bfd/erTbojnGSFwLKNjXfIcjaVcbDH15W0m6R9glnbZkKL F36raA4Y3DYdf9bQFgWJIpMm3OWhPCJNxdOQpqfZgcQJ768ctKqgn+QBIuImnwvFz24j u4LdpMBw/++ej9BhUQnzy4hNyB0yMmhWpTz/WLqW904GylCDr+3XQpss4UoKaLpGMcTC 8fmtXH1aP77aYmF9pA3MqqVdB7wnT49ggRWaBWfxQD52p9SJl1OFK2dSynRxEXvNNGiT 2QoFcYSE5Nu9CvvspVwC2hq8c/5qOY/Vz1ze4X1FxQjkpMCfw7hhxdtf2FPbVhonS3nS xXtw== 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:dkim-signature; bh=FnQQsmu2PoAxzjaqNV9WFO09njNrUxb7Lfkd5IwbIUg=; b=tReIUiYxmRI89p8t4A4STZrI05vxEzQNhCKe3fO9Q10WbRW0HiXvo26Lc5ndzLuklR WIjVgytyjGHkWEMqZBZZdyrt5BnSxBkGk7kdU2rt3pSWVmbbFs+OU98riFm976QdY5jt qrrxBmVVln3h7NJCoClLqF5DOh/egoAtTvkaarAx7cC5my/lWU+52sl25hWofT2POcH/ tabBlknL83YX0cBeLmu3Sa9v8aP8BkR5I35LCfppM9AuzrB2YgoRy7n3np9ozUiFlSWg ZhNUXs8mgQI6pZ7T/pm+t/6erriHIXyhO+HZ0DBBJoVfFLQiKIxvzY/xLibh+YLWavzp sXbA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@tq-group.com header.s=key1 header.b=ehr43xI6; dkim=pass header.i=@tq-group.com header.s=key1 header.b=UyG8XPM3; 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=NONE sp=NONE dis=NONE) header.from=tq-group.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id l15-20020a056a0016cf00b004e1079907a0si1846914pfc.137.2022.03.09.03.53.56; Wed, 09 Mar 2022 03:54:11 -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=@tq-group.com header.s=key1 header.b=ehr43xI6; dkim=pass header.i=@tq-group.com header.s=key1 header.b=UyG8XPM3; 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=NONE sp=NONE dis=NONE) header.from=tq-group.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232489AbiCILnW (ORCPT + 99 others); Wed, 9 Mar 2022 06:43:22 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48654 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232397AbiCILm6 (ORCPT ); Wed, 9 Mar 2022 06:42:58 -0500 Received: from mx1.tq-group.com (mx1.tq-group.com [93.104.207.81]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 24DC516BCE0; Wed, 9 Mar 2022 03:41:58 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=tq-group.com; i=@tq-group.com; q=dns/txt; s=key1; t=1646826119; x=1678362119; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=FnQQsmu2PoAxzjaqNV9WFO09njNrUxb7Lfkd5IwbIUg=; b=ehr43xI6BpcYmgXBr4QBRwDVgkF9W3qzVk5uFZWoUggB9jvEHGZDsh4+ +WulPrXPXX5j2i5PE3M9mxU6FGKfci1+c84chlo5OPgiZ+pb1FOIQU33J OhkSVACjU7WWlW8PfXZbjObPhhOwwOk5T1/A7G7PnbwlXFlHKYqWccCuq KQkKQUWMFCZ5kNF5M+419xlUwH2ltB+IoUEvUAo0EKvgAJYRGwDkwZRDF QYljgmwUQbOUE2ML2t2EAWiwU6LuNavNnLQYH/bb7+gh4p5CSvyaMSPBw umPF7EncHbYngY77BIT3A0Exqj97PIciE55jf8qhbQEoy+f/PdhJ+02Fj w==; X-IronPort-AV: E=Sophos;i="5.90,167,1643670000"; d="scan'208";a="22553373" Received: from unknown (HELO tq-pgp-pr1.tq-net.de) ([192.168.6.15]) by mx1-pgp.tq-group.com with ESMTP; 09 Mar 2022 12:41:55 +0100 Received: from mx1.tq-group.com ([192.168.6.7]) by tq-pgp-pr1.tq-net.de (PGP Universal service); Wed, 09 Mar 2022 12:41:55 +0100 X-PGP-Universal: processed; by tq-pgp-pr1.tq-net.de on Wed, 09 Mar 2022 12:41:55 +0100 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=tq-group.com; i=@tq-group.com; q=dns/txt; s=key1; t=1646826115; x=1678362115; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=FnQQsmu2PoAxzjaqNV9WFO09njNrUxb7Lfkd5IwbIUg=; b=UyG8XPM3anOjIfRU3RwGxQVBFxW2FoEiOO/K1+Hmr5pbbQEghJdK9fR2 a5U6y7R7enKc/2ZNYQArt+2Zp40xNpKMBgTK40N/OeNwDFF4ctetWcWiE MwHzPv1qMaQ446UKUzFvKXLUHEcb3HuiaYtluUE2FQv+PrA5mX6dGmhT2 z3H+eyhuUNxKHU9AF1nKmv86FGU8gPr6poaGswhYsQ8q1npnrCj98pIAN tqaGgegs5F/60xrqd/eJUMw9uJkRsPq3iLicMxzm09FiWPcOogjJmSGbC pbZ/YG2JU6dAYOf75xYaLs4ar7LsjJq1yib9ziqLNNHajH1+nNVy6acnF w==; X-IronPort-AV: E=Sophos;i="5.90,167,1643670000"; d="scan'208";a="22553372" Received: from vtuxmail01.tq-net.de ([10.115.0.20]) by mx1.tq-group.com with ESMTP; 09 Mar 2022 12:41:55 +0100 Received: from steina-w.tq-net.de (unknown [10.123.49.12]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (No client certificate requested) by vtuxmail01.tq-net.de (Postfix) with ESMTPSA id 429B7280065; Wed, 9 Mar 2022 12:41:55 +0100 (CET) From: Alexander Stein To: Steve Longerbeam , Philipp Zabel , Mauro Carvalho Chehab , Greg Kroah-Hartman , Shawn Guo , Sascha Hauer , Pengutronix Kernel Team , Fabio Estevam , NXP Linux Team , Rui Miguel Silva , Laurent Pinchart , Dorota Czaplejewicz Cc: Alexander Stein , linux-media@vger.kernel.org, linux-staging@lists.linux.dev, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH v3 7/8] media: imx: utils: initialize local variable Date: Wed, 9 Mar 2022 12:41:43 +0100 Message-Id: <20220309114144.120643-8-alexander.stein@ew.tq-group.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220309114144.120643-1-alexander.stein@ew.tq-group.com> References: <20220309114144.120643-1-alexander.stein@ew.tq-group.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_EF,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE 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 imx_media_enum_mbus_formats might not set code at all, this would result in imx_media_find_mbus_format using an uninitialized variable. Set code to 0 to avoid returning a wrong pixel format. Signed-off-by: Alexander Stein --- Changes in v3: * None drivers/staging/media/imx/imx-media-utils.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/staging/media/imx/imx-media-utils.c b/drivers/staging/media/imx/imx-media-utils.c index e69bbe0d6c83..1665cbd6b3a5 100644 --- a/drivers/staging/media/imx/imx-media-utils.c +++ b/drivers/staging/media/imx/imx-media-utils.c @@ -610,7 +610,7 @@ static int imx56_media_mbus_fmt_to_pix_fmt(struct v4l2_pix_format *pix, * so until it does convert to a supported YUV format. */ if (cc->ipufmt && cc->cs == IPUV3_COLORSPACE_YUV) { - u32 code; + u32 code = 0; imx_media_enum_mbus_formats(&code, 0, PIXFMT_SEL_YUV); cc = imx_media_find_mbus_format(code, PIXFMT_SEL_YUV); -- 2.25.1