Received: by 2002:a05:7412:3784:b0:e2:908c:2ebd with SMTP id jk4csp1249420rdb; Mon, 2 Oct 2023 04:10:01 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHCFJl7wXcvCjesD7XMfUdTDyU0SKUtI3FQ6rJ83OcMFmFKb7O1Waq77CYoCLfhyoQB1+t/ X-Received: by 2002:a92:c243:0:b0:34f:c7f7:18b with SMTP id k3-20020a92c243000000b0034fc7f7018bmr14571158ilo.2.1696245000864; Mon, 02 Oct 2023 04:10:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696245000; cv=none; d=google.com; s=arc-20160816; b=uLGyBvDCXLDT30QECjvwHPofziDcpcZIRB7mnEEazssu/nJuPw1BOKPSam2OadTvD7 vdZfODdQIKNNpCXTzPPkhWEXwdMPiXcLs40A1CGXpFDclDiUrQKS5ABUyTWVsn7eJucg 41STL17WRBn9W9+t6a/t3d20SdAGKzU8pWNa3c/46IS5ucGsyxJ9x35H9d0Un7AjVGWm qcy1GPcq5zfJlR/DmcEBCcsZeNiduMFNEwjngIrmGksariOX3Yqd6rc2DERZmau8Y0Y4 d9j95B2M5f+XzsczXlqRF9Z/iiUTnMUX1Q0yos5geFh5MyfReJEqD7SGkslNKBgMFtZq cqGA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id; bh=GdxnqbBTD21mFajYTxMcf9hxMdg8JXFBQdDjhbnjePo=; fh=aIbMHNu7RjJbKYmL5lT/Fsu37Q6lCZKcJzBA0Mt0BbY=; b=jMOmGW2u6e2cIY13yM6K81BX7EPPZ8wVRvMu42BwMk6xIT4KcLAY4Djcf1MuXDooAL Ded6oPib3J/OTKd2/s/l/YR8JOFU2fNcseT4B6+ih58bYfQed0cGdXkfSa6eVEuIelLv yOMVjH/FYxESGz2NNJlYaH42xG2kXupfe3fQ84dXbnJL8+l0oRD7n5n1il3cagCBKVlm kMKDTRsE1xowhKKQUbn2DyKOFkGHMvuTE+/jw88uKxg7i+IhS8GLrtc0roWytw+xFA91 Co2oBVX0CRQqVKU7WPH9raYuY27RlzMg95CyF4gatNQ4fTA5Wiwu6z7+kwPl9xw2+SSi MVQw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.34 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=xs4all.nl Return-Path: Received: from howler.vger.email (howler.vger.email. [23.128.96.34]) by mx.google.com with ESMTPS id k7-20020a634b47000000b005774c943feasi28330952pgl.735.2023.10.02.04.09.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 02 Oct 2023 04:10:00 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.34 as permitted sender) client-ip=23.128.96.34; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.34 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=xs4all.nl Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by howler.vger.email (Postfix) with ESMTP id 5641780259CC; Mon, 2 Oct 2023 03:57:50 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at howler.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236565AbjJBK50 (ORCPT + 99 others); Mon, 2 Oct 2023 06:57:26 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58248 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236573AbjJBK5V (ORCPT ); Mon, 2 Oct 2023 06:57:21 -0400 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D689AB3; Mon, 2 Oct 2023 03:57:18 -0700 (PDT) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 65A1CC433C9; Mon, 2 Oct 2023 10:57:16 +0000 (UTC) Message-ID: <4e9452b9-a02c-47eb-ba8f-5949f07f707d@xs4all.nl> Date: Mon, 2 Oct 2023 12:57:14 +0200 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v6 13/13] media: platform: mtk-mdp3: fix uninitialized variable in mdp_path_config() Content-Language: en-US, nl To: Moudy Ho , Mauro Carvalho Chehab , Matthias Brugger , AngeloGioacchino Del Regno , Ping-Hsun Wu , daoyuan huang Cc: linux-kernel@vger.kernel.org, linux-media@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org References: <20230922074145.11977-1-moudy.ho@mediatek.com> <20230922074145.11977-14-moudy.ho@mediatek.com> From: Hans Verkuil In-Reply-To: <20230922074145.11977-14-moudy.ho@mediatek.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-1.7 required=5.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,RCVD_IN_DNSWL_BLOCKED,SPF_HELO_NONE, SPF_PASS autolearn=no 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-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (howler.vger.email [0.0.0.0]); Mon, 02 Oct 2023 03:57:50 -0700 (PDT) On 22/09/2023 09:41, Moudy Ho wrote: > Fix the build warnings that were detected by the linux-media > build scripts tool: > > drivers/media/platform/mediatek/mdp3/mtk-mdp3-cmdq.c: > In function 'mdp_path_config.isra': > drivers/media/platform/mediatek/mdp3/mtk-mdp3-cmdq.c:443:51: > warning: 'ctx' may be used uninitialized [-Wmaybe-uninitialized] > 443 | out = CFG_COMP(MT8195, ctx->param, outputs[0]); > | ~~~^~~~~~~ > drivers/media/platform/mediatek/mdp3/mtk-img-ipi.h:137:25: note: > in definition of macro 'CFG_COMP' > 137 | (IS_ERR_OR_NULL(comp) ? 0 : _CFG_COMP(plat, comp, mem)) > | ^~~~ > drivers/media/platform/mediatek/mdp3/mtk-mdp3-cmdq.c:396:30: > note: 'ctx' was declared here > 396 | struct mdp_comp_ctx *ctx; > | > > Fixes: 61890ccaefaf ("media: platform: mtk-mdp3: add MediaTek MDP3 driver") > Signed-off-by: Moudy Ho > --- > drivers/media/platform/mediatek/mdp3/mtk-mdp3-cmdq.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/drivers/media/platform/mediatek/mdp3/mtk-mdp3-cmdq.c b/drivers/media/platform/mediatek/mdp3/mtk-mdp3-cmdq.c > index 15a0b944745e..4a8d941178aa 100644 > --- a/drivers/media/platform/mediatek/mdp3/mtk-mdp3-cmdq.c > +++ b/drivers/media/platform/mediatek/mdp3/mtk-mdp3-cmdq.c > @@ -436,13 +436,13 @@ static int mdp_path_config(struct mdp_dev *mdp, struct mdp_cmdq_cmd *cmd, > if (mdp_cfg_comp_is_dummy(path->mdp_dev, inner_id)) > continue; > > + ctx = &path->comps[index]; > if (CFG_CHECK(MT8183, p_id)) > out = CFG_COMP(MT8183, ctx->param, outputs[0]); > else if (CFG_CHECK(MT8195, p_id)) > out = CFG_COMP(MT8195, ctx->param, outputs[0]); > > compose = path->composes[out]; > - ctx = &path->comps[index]; > ret = call_op(ctx, config_frame, cmd, compose); > if (ret) > return ret; Hmm, this patch really should be a separate patch on top of the media staging branch: it is wrong there as well, except you don't get a build warning. Other changes in this patch series caused this warning to appear, but the actual bug is already present in the current staging code. Regards, Hans