mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Hans Verkuil <hverkuil-cisco@xs4all.nl>
To: Moudy Ho <moudy.ho@mediatek.com>,
	Mauro Carvalho Chehab <mchehab@kernel.org>,
	Matthias Brugger <matthias.bgg@gmail.com>,
	AngeloGioacchino Del Regno 
	<angelogioacchino.delregno@collabora.com>,
	Ping-Hsun Wu <ping-hsun.wu@mediatek.com>,
	daoyuan huang <daoyuan.huang@mediatek.com>
Cc: linux-kernel@vger.kernel.org, linux-media@vger.kernel.org,
	linux-arm-kernel@lists.infradead.org,
	linux-mediatek@lists.infradead.org
Subject: Re: [PATCH v6 13/13] media: platform: mtk-mdp3: fix uninitialized variable in mdp_path_config()
Date: Mon, 2 Oct 2023 12:57:14 +0200	[thread overview]
Message-ID: <4e9452b9-a02c-47eb-ba8f-5949f07f707d@xs4all.nl> (raw)
In-Reply-To: <20230922074145.11977-14-moudy.ho@mediatek.com>

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 <moudy.ho@mediatek.com>
> ---
>  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

  reply	other threads:[~2023-10-02 10:57 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-09-22  7:41 [PATCH v6 00/13] add support MDP3 on MT8195 platform Moudy Ho
2023-09-22  7:41 ` [PATCH v6 01/13] media: platform: mtk-mdp3: add support second sets of MMSYS Moudy Ho
2023-09-22  7:41 ` [PATCH v6 02/13] media: platform: mtk-mdp3: add support second sets of MUTEX Moudy Ho
2023-09-22  7:41 ` [PATCH v6 03/13] media: platform: mtk-mdp3: introduce more pipelines from MT8195 Moudy Ho
2023-09-22  7:41 ` [PATCH v6 04/13] media: platform: mtk-mdp3: introduce more MDP3 components Moudy Ho
2023-09-22  7:41 ` [PATCH v6 05/13] media: platform: mtk-mdp3: add checks for dummy components Moudy Ho
2023-09-22  7:41 ` [PATCH v6 06/13] media: platform: mtk-mdp3: avoid multiple driver registrations Moudy Ho
2023-09-22  7:41 ` [PATCH v6 07/13] media: platform: mtk-mdp3: extend GCE event waiting in RDMA and WROT Moudy Ho
2023-09-22  7:41 ` [PATCH v6 08/13] media: platform: mtk-mdp3: add support for blending multiple components Moudy Ho
2023-09-22  7:41 ` [PATCH v6 09/13] media: platform: mtk-mdp3: add mt8195 platform configuration Moudy Ho
2023-09-22  7:41 ` [PATCH v6 10/13] media: platform: mtk-mdp3: add mt8195 shared memory configurations Moudy Ho
2023-09-22  7:41 ` [PATCH v6 11/13] media: platform: mtk-mdp3: add mt8195 MDP3 component settings Moudy Ho
2023-09-22  7:41 ` [PATCH v6 12/13] media: platform: mtk-mdp3: add support for parallel pipe to improve FPS Moudy Ho
2023-09-22  7:41 ` [PATCH v6 13/13] media: platform: mtk-mdp3: fix uninitialized variable in mdp_path_config() Moudy Ho
2023-10-02 10:57   ` Hans Verkuil [this message]
2023-10-03  2:14     ` Moudy Ho (何宗原)

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4e9452b9-a02c-47eb-ba8f-5949f07f707d@xs4all.nl \
    --to=hverkuil-cisco@xs4all.nl \
    --cc=angelogioacchino.delregno@collabora.com \
    --cc=daoyuan.huang@mediatek.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-media@vger.kernel.org \
    --cc=linux-mediatek@lists.infradead.org \
    --cc=matthias.bgg@gmail.com \
    --cc=mchehab@kernel.org \
    --cc=moudy.ho@mediatek.com \
    --cc=ping-hsun.wu@mediatek.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®