提交 dfdb3be4 编写于 作者: C Colin Ian King 提交者: Rob Clark

drm/msm: fix unsigned comparison with less than zero

The return from the call to _mixer_stages can be a negative error
code however this is being assigned to an unsigned variable 'stages'
hence the check is always false. Fix this by making 'stages' an
int.

Detected by Coccinelle ("Unsigned expression compared with zero:
stages < 0")

Fixes: 25fdd593 ("drm/msm: Add SDM845 DPU support")
Signed-off-by: NColin Ian King <colin.king@canonical.com>
Signed-off-by: NRob Clark <robdclark@gmail.com>
上级 f8fc924e
...@@ -297,7 +297,7 @@ static void dpu_hw_ctl_setup_blendstage(struct dpu_hw_ctl *ctx, ...@@ -297,7 +297,7 @@ static void dpu_hw_ctl_setup_blendstage(struct dpu_hw_ctl *ctx,
u32 mixercfg = 0, mixercfg_ext = 0, mix, ext; u32 mixercfg = 0, mixercfg_ext = 0, mix, ext;
u32 mixercfg_ext2 = 0, mixercfg_ext3 = 0; u32 mixercfg_ext2 = 0, mixercfg_ext3 = 0;
int i, j; int i, j;
u8 stages; int stages;
int pipes_per_stage; int pipes_per_stage;
stages = _mixer_stages(ctx->mixer_hw_caps, ctx->mixer_count, lm); stages = _mixer_stages(ctx->mixer_hw_caps, ctx->mixer_count, lm);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册