drm/msm/disp/dpu1: fix warning reported by kernel bot in dpu driver
PATCH 1/1 drm/msm/disp/dpu1: fix warning reported by kernel bot in dpu driver
Fix a warning, pointing to an early deference of a variable before check. This bug was introduced in the following commit.
commit 4259ff7ae509
("drm/msm/dpu: add support for pcc color block in dpu driver")
Reported-by kernel test robot <[email protected]>
Reported-by Dan Carpenter <[email protected]>
Signed-off-by Kalyan Thota <[email protected]>
--- drivers/gpu/drm/msm/disp/dpu1/dpu_hw_dspp.c | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-)
drivers/gpu/drm/msm/disp/dpu1/dpu_hw_dspp.c +9 -3
@@ -26,10 +26,16 @@ static void dpu_setup_dspp_pcc(struct dpu_hw_dspp *ctx, struct dpu_hw_pcc_cfg *cfg) { -u32 base = ctx->cap->sblk->pcc.base; +u32 base; -if (!ctx || !base) { -DRM_ERROR ("invalid ctx %pK pcc base 0x%x\n" , ctx, base); +if (!ctx) { +DRM_ERROR ("invalid dspp ctx %pK\n" , ctx); +return ; + } + + base = ctx->cap->sblk->pcc.base; +if (!base) { +DRM_ERROR ("invalid pcc base 0x%x\n" , base);return ; }
Signature · 6 lines
2.7.4 _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel