Skip to content

Commit eb174bd

Browse files
sunlimingAbhinav Kumar
authored andcommitted
drm/msm/dpu: Fix variable dereferenced before check
Fixes the following smatch warning: drivers/gpu/drm/msm/disp/dpu1/dpu_encoder_phys_wb.c:261 dpu_encoder_phys_wb_atomic_check() warn: variable dereferenced before check 'conn_state' Fixes: d7d0e73 ("drm/msm/dpu: introduce the dpu_encoder_phys_* for writeback") Signed-off-by: sunliming <[email protected]> Reported-by: kernel test robot <[email protected]> Reported-by: Dan Carpenter <[email protected]> Reviewed-by: Abhinav Kumar <[email protected]> Patchwork: https://patchwork.freedesktop.org/patch/490850/ Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Abhinav Kumar <[email protected]>
1 parent 0769d0a commit eb174bd

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

drivers/gpu/drm/msm/disp/dpu1/dpu_encoder_phys_wb.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -252,11 +252,6 @@ static int dpu_encoder_phys_wb_atomic_check(
252252
DPU_DEBUG("[atomic_check:%d, \"%s\",%d,%d]\n",
253253
phys_enc->wb_idx, mode->name, mode->hdisplay, mode->vdisplay);
254254

255-
if (!conn_state->writeback_job || !conn_state->writeback_job->fb)
256-
return 0;
257-
258-
fb = conn_state->writeback_job->fb;
259-
260255
if (!conn_state || !conn_state->connector) {
261256
DPU_ERROR("invalid connector state\n");
262257
return -EINVAL;
@@ -267,6 +262,11 @@ static int dpu_encoder_phys_wb_atomic_check(
267262
return -EINVAL;
268263
}
269264

265+
if (!conn_state->writeback_job || !conn_state->writeback_job->fb)
266+
return 0;
267+
268+
fb = conn_state->writeback_job->fb;
269+
270270
DPU_DEBUG("[fb_id:%u][fb:%u,%u]\n", fb->base.id,
271271
fb->width, fb->height);
272272

0 commit comments

Comments
 (0)