Skip to content

Commit 2a76e76

Browse files
MoudyHoHans Verkuil
authored andcommitted
media: platform: mtk-mdp3: fix uninitialized variable in mdp_path_config()
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: warning: 'ctx' may be used uninitialized [-Wmaybe-uninitialized] | out = CFG_COMP(MT8195, ctx->param, outputs[0]); | ~~~^~~~~~~ drivers/media/platform/mediatek/mdp3/mtk-img-ipi.h: note: in definition of macro 'CFG_COMP' | (IS_ERR_OR_NULL(comp) ? 0 : _CFG_COMP(plat, comp, mem)) | ^~~~ drivers/media/platform/mediatek/mdp3/mtk-mdp3-cmdq.c: note: 'ctx' was declared here | struct mdp_comp_ctx *ctx; | Fixes: 61890cc ("media: platform: mtk-mdp3: add MediaTek MDP3 driver") Signed-off-by: Moudy Ho <[email protected]> Reviewed-by: AngeloGioacchino Del Regno <[email protected]> Signed-off-by: Hans Verkuil <[email protected]>
1 parent 56c0ac0 commit 2a76e76

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/media/platform/mediatek/mdp3/mtk-mdp3-cmdq.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -261,11 +261,11 @@ static int mdp_path_config(struct mdp_dev *mdp, struct mdp_cmdq_cmd *cmd,
261261
const struct v4l2_rect *compose;
262262
u32 out = 0;
263263

264+
ctx = &path->comps[index];
264265
if (CFG_CHECK(MT8183, p_id))
265266
out = CFG_COMP(MT8183, ctx->param, outputs[0]);
266267

267268
compose = path->composes[out];
268-
ctx = &path->comps[index];
269269
ret = call_op(ctx, config_frame, cmd, compose);
270270
if (ret)
271271
return ret;

0 commit comments

Comments
 (0)