[PATCH] drm/msm/dpu: Fix pointer dereferenced before checking

2022-05-30 Thread Haowen Bai
The ctx->hw is dereferencing before null checking, so move it after checking. Signed-off-by: Haowen Bai --- drivers/gpu/drm/msm/disp/dpu1/dpu_hw_wb.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_hw_wb.c b/drivers/gpu/drm/msm/disp/d

[PATCH] drm/nouveau/therm: Fix pointer dereferenced before checking

2022-05-29 Thread Haowen Bai
The fan->base is dereferencing before null checking, so move it after checking. Signed-off-by: Haowen Bai --- drivers/gpu/drm/nouveau/nvkm/subdev/therm/fanpwm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/therm/fanpwm.c b/drivers/

[PATCH] drm/msm/dpu: Fix pointer dereferenced before checking

2022-05-29 Thread Haowen Bai
The phys_enc->wb_idx is dereferencing before null checking, so move it after checking. Signed-off-by: Haowen Bai --- drivers/gpu/drm/msm/disp/dpu1/dpu_encoder_phys_wb.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder_phys_wb.c

[PATCH] drm/amdgpu: Return true/false (not 1/0) from bool functions

2022-05-09 Thread Haowen Bai
Return boolean values ("true" or "false") instead of 1 or 0 from bool functions. Signed-off-by: Haowen Bai --- drivers/gpu/drm/amd/amdgpu/gmc_v11_0.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/drm/amd/amdgpu/gmc_v11_0.c b/driver

[PATCH] drm/rockchip: Remove unneeded semicolon

2022-05-05 Thread Haowen Bai
Fixes coccicheck warning: drivers/gpu/drm/rockchip/rockchip_drm_vop2.c:1476:2-3: Unneeded semicolon Signed-off-by: Haowen Bai --- drivers/gpu/drm/rockchip/rockchip_drm_vop2.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/drm/rockchip/rockchip_drm_vop2.c b

[PATCH] drm/amdkfd: Return true/false (not 1/0) from bool functions

2022-05-05 Thread Haowen Bai
Return boolean values ("true" or "false") instead of 1 or 0 from bool functions. Signed-off-by: Haowen Bai --- drivers/gpu/drm/amd/amdkfd/kfd_int_process_v11.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/gpu/drm/amd/amdkfd/kfd_int_proc

[PATCH] drm/kmb: Fix unsigned function returning negative constant

2022-04-24 Thread Haowen Bai
The function check_pixel_format has an unsigned return type, but returns a negative constant to indicate an error condition. So we change unsigned to int. Signed-off-by: Haowen Bai --- drivers/gpu/drm/kmb/kmb_plane.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers

[PATCH] drm/amdgpu: Remove useless kfree

2022-04-21 Thread Haowen Bai
After alloc fail, we do not need to kfree. Signed-off-by: Haowen Bai --- drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c | 1 - 1 file changed, 1 deletion(-) diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c index ec709997c9c7..5fb3e69c04c4 100644 --- a

[PATCH] drm/amd/display: Remove useless code

2022-04-21 Thread Haowen Bai
aux_rep only memset but no use at all, so we drop it. Signed-off-by: Haowen Bai --- drivers/gpu/drm/amd/display/dc/dce/dce_aux.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/drivers/gpu/drm/amd/display/dc/dce/dce_aux.c b/drivers/gpu/drm/amd/display/dc/dce/dce_aux.c index 8e814000db62

[PATCH] drm/msm/mdp5: Eliminate useless code

2022-04-18 Thread Haowen Bai
Since mdp5_state is initialized twice at the same time, so we make code simple and easy to understand by delete one. Signed-off-by: Haowen Bai --- drivers/gpu/drm/msm/disp/mdp5/mdp5_plane.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/drivers/gpu/drm/msm/disp/mdp5/mdp5_plane.c b

[PATCH] drm/amd/display: Fix pointer dereferenced before checking

2022-04-08 Thread Haowen Bai
The pointer dc is dereferencing pointer plane_state before plane_state is being null checked. Fix this by assigning plane_state->ctx->dc to dc only if plane_state is not NULL, otherwise just NULL. Signed-off-by: Haowen Bai --- drivers/gpu/drm/amd/display/dc/dcn10/dcn10_hw_sequencer.c | 2

[PATCH] drm/amd/display: Fix indenting mistakes in dcn10_hw_sequencer.c

2022-04-08 Thread Haowen Bai
Smatch reports the following: drivers/gpu/drm/amd/amdgpu/../display/dc/dcn10/dcn10_hw_sequencer.c:2174 dcn10_enable_vblanks_synchronization() warn: if statement not indented Signed-off-by: Haowen Bai --- drivers/gpu/drm/amd/display/dc/dcn10/dcn10_hw_sequencer.c | 14 +++--- 1 file

[PATCH] Hvideo: fbdev: pm2fb: Fix a kernel-doc formatting issue

2022-04-02 Thread Haowen Bai
but isn't a kernel-doc comment. Refer Documentation/doc-guide/kernel-doc.rst * Device initialisation drivers/video/fbdev/pm2fb.c:1714: warning: This comment starts with '/**', but isn't a kernel-doc comment. Refer Documentation/doc-guide/kernel-doc.rst * Device removal.

[PATCH V2] drm/amdgpu/vcn: Remove unneeded semicolon

2022-04-01 Thread Haowen Bai
report by coccicheck: drivers/gpu/drm/amd/amdgpu/vcn_v2_5.c:1951:2-3: Unneeded semicolon Fixes: c543dcbe4237 ("drm/amdgpu/vcn: Add VCN ras error query support") Signed-off-by: Haowen Bai --- V1->V2: change title; change Fixed info; drivers/gpu/drm/amd/amdgpu/vcn_v2_5.c | 2 +- 1

[PATCH] video: fbdev: sis: fix potential NULL dereference in sisfb_post_sis300()

2022-04-01 Thread Haowen Bai
bios could be null without checking null and return in this function, but still dereference bios[0xf5]. Signed-off-by: Haowen Bai --- drivers/video/fbdev/sis/sis_main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/video/fbdev/sis/sis_main.c b/drivers/video/fbdev

[PATCH] drm/amdgpu/vcn: remove Unneeded semicolon

2022-03-31 Thread Haowen Bai
report by coccicheck: drivers/gpu/drm/amd/amdgpu/vcn_v2_5.c:1951:2-3: Unneeded semicolon fixed c543dcb ("drm/amdgpu/vcn: Add VCN ras error query support") Signed-off-by: Haowen Bai --- drivers/gpu/drm/amd/amdgpu/vcn_v2_5.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) di

[PATCH] drm: gma500: clean up some style problems reported by checkpatch.pl

2022-03-25 Thread Haowen Bai
WARNING: Statements should start on a tabstop WARNING: Missing a blank line after declarations Signed-off-by: Haowen Bai --- drivers/gpu/drm/gma500/mid_bios.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/gma500/mid_bios.c b/drivers/gpu/drm/gma500

[PATCH] drm/amd/display: Fix pointer dereferenced before checking

2022-03-25 Thread Haowen Bai
The pointer edid_buf is dereferencing pointer edid before edid is being null checked. Fix this by assigning edid->raw_edid to edid_buf only if edid is not NULL, otherwise just NULL. Signed-off-by: Haowen Bai --- drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_helpers.c | 2 +- 1 file chan

[PATCH] drm/amd/display: Fix pointer dereferenced before checking

2022-03-25 Thread Haowen Bai
The value actual_pix_clk_100Hz is dereferencing pointer pix_clk_params before pix_clk_params is being null checked. Fix this by assigning pix_clk_params->requested_pix_clk_100hz to actual_pix_clk_100Hz only if pix_clk_params is not NULL, otherwise just NULL. Signed-off-by: Haowen

[PATCH] drm/amd/display: use NULL instead of using plain integer as pointer

2022-03-23 Thread Haowen Bai
This fixes the following sparse warnings: drivers/gpu/drm/amd/amdgpu/../display/dc/dce112/dce112_resource.c:865:16: warning: Using plain integer as NULL pointer Signed-off-by: Haowen Bai --- drivers/gpu/drm/amd/display/dc/dce112/dce112_resource.c | 2 +- 1 file changed, 1 insertion(+), 1

[PATCH] gpu: drm: Fix duplicate included linux/module.h

2022-03-23 Thread Haowen Bai
Clean up the following includecheck warning: drivers/gpu/drm/drm_gem_shmem_helper.c: linux/module.h is included more than once. No functional change. Signed-off-by: Haowen Bai --- drivers/gpu/drm/drm_gem_shmem_helper.c | 1 - 1 file changed, 1 deletion(-) diff --git a/drivers/gpu/drm

[PATCH] drm/amd/display: use NULL instead of using plain integer as pointer

2022-03-23 Thread Haowen Bai
This fixes the following sparse warnings: drivers/gpu/drm/amd/amdgpu/../display/dc/dml/dsc/rc_calc_fpu.c:71:40: warning: Using plain integer as NULL pointer Signed-off-by: Haowen Bai --- drivers/gpu/drm/amd/display/dc/dml/dsc/rc_calc_fpu.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion

[PATCH] drm/amd/display: use NULL instead of using plain integer as pointer

2022-03-23 Thread Haowen Bai
This fixes the following sparse warnings: drivers/gpu/drm/amd/amdgpu/../display/dc/core/dc_resource.c:1910:16: warning: Using plain integer as NULL pointer Signed-off-by: Haowen Bai --- drivers/gpu/drm/amd/display/dc/core/dc_resource.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion

[PATCH] drm/omap: fix a NULL pointer dereferenced

2022-03-19 Thread Haowen Bai
r_ovl is NULL but dereferenced Signed-off-by: Haowen Bai --- drivers/gpu/drm/omapdrm/omap_overlay.c | 1 - 1 file changed, 1 deletion(-) diff --git a/drivers/gpu/drm/omapdrm/omap_overlay.c b/drivers/gpu/drm/omapdrm/omap_overlay.c index 10730c9..d09aaf6 100644 --- a/drivers/gpu/drm/omapdrm

[PATCH] video: fbdev: fix warning comparing pointer to 0

2022-03-11 Thread Haowen Bai
Fix the following coccicheck warning: drivers/video/fbdev/offb.c:415:13-14: WARNING comparing pointer to 0 Signed-off-by: Haowen Bai --- drivers/video/fbdev/offb.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/video/fbdev/offb.c b/drivers/video/fbdev/offb.c index