[PATCH] drm/radeon: check the alloc_workqueue return value in radeon_crtc_init()

2023-11-29 Thread Yang Yingliang
From: Yang Yingliang check the alloc_workqueue return value in radeon_crtc_init() to avoid null-ptr-deref. Fixes: fa7f517cb26e ("drm/radeon: rework page flip handling v4") Signed-off-by: Yang Yingliang --- drivers/gpu/drm/radeon/radeon_display.c | 7 ++- 1 file changed, 6 insert

[PATCH] drm/panel: nt36523: fix return value check in nt36523_probe()

2023-11-29 Thread Yang Yingliang
From: Yang Yingliang mipi_dsi_device_register_full() never returns NULL pointer, it will return ERR_PTR() when it fails, so replace the check with IS_ERR(). Fixes: 0993234a0045 ("drm/panel: Add driver for Novatek NT36523") Signed-off-by: Yang Yingliang --- drivers/gpu/drm/panel/pan

[PATCH] drm/amd/display: Fix missing unlock in dm_handle_mst_sideband_msg_ready_event()

2023-07-25 Thread Yang Yingliang
Add missing mutex_unlock() in error path in dm_handle_mst_sideband_msg_ready_event(). Fixes: 4f6d9e38c4d2 ("drm/amd/display: Add polling method to handle MST reply packet") Signed-off-by: Yang Yingliang --- drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_mst_types.c | 1 + 1 file

[PATCH -next] drm: xlnx: zynqmp_dpsub: fix missing clk_disable_unprepare() in error path in zynqmp_dpsub_init_clocks()

2022-10-28 Thread Yang Yingliang
ub") Signed-off-by: Yang Yingliang --- drivers/gpu/drm/xlnx/zynqmp_dpsub.c | 16 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/drivers/gpu/drm/xlnx/zynqmp_dpsub.c b/drivers/gpu/drm/xlnx/zynqmp_dpsub.c index bab862484d42..50abe222fcc3 100644 --- a/drivers/gpu/drm

[PATCH RESEND] gpu: host1x: fix memory leak of device names

2022-10-28 Thread Yang Yingliang
in kobejct_cleanup(). Add a release() function to device, it's empty, because the context devices are freed together in host1x_memory_context_list_free(). Fixes: 8aa5bcb61612 ("gpu: host1x: Add context device management code") Signed-off-by: Yang Yingliang --- The fix tag is in mainlin

Re: [PATCH -next] gpu: host1x: fix memory leak of device names

2022-10-28 Thread Yang Yingliang
Sorry for the noisy, it should for linux master, not next, I will resend it with right title, please ignore this patch. Thanks, Yang On 2022/10/28 20:52, Yang Yingliang wrote: The device names allocated by dev_set_name() need be freed before module unloading, but they can not be freed because

[PATCH -next] gpu: host1x: fix memory leak of device names

2022-10-28 Thread Yang Yingliang
in kobejct_cleanup(). Add a release() function to device, it's empty, because the context devices are freed together in host1x_memory_context_list_free(). Fixes: 8aa5bcb61612 ("gpu: host1x: Add context device management code") Signed-off-by: Yang Yingliang --- drivers/gpu/host1x/cont

Re: [PATCH] drm/amdgpu/discovery: fix possible memory leak

2022-10-19 Thread Yang Yingliang
Hi, On 2022/10/19 11:37, Luben Tuikov wrote: On 2022-10-18 04:05, Yang Yingliang wrote: If kset_register() fails, the refcount of device is not 0, the name allocated in dev_set_name() is leaked. Fix this by calling kset_put(), so that it will be freed in callback function kobject_cleanup

[PATCH] drm/mipi-dsi: fix possible memory leak in mipi_dsi_device_register_full()

2022-10-18 Thread Yang Yingliang
If mipi_dsi_device_add() fails, the refcount of device is not 0, the name allocated in dev_set_name() is leaked. Fix this by calling put_device(), so that it will be freed in callback function kobject_cleanup(). Fixes: 068a00233969 ("drm: Add MIPI DSI bus support") Signed-off-by: Yang

[PATCH] drm/amdgpu/discovery: fix possible memory leak

2022-10-18 Thread Yang Yingliang
If kset_register() fails, the refcount of device is not 0, the name allocated in dev_set_name() is leaked. Fix this by calling kset_put(), so that it will be freed in callback function kobject_cleanup(). Fixes: a6c40b178092 ("drm/amdgpu: Show IP discovery in sysfs") Signed-off-by: Yang

[PATCH -next] drm/amdgpu/si_dma: remove unused variable in si_dma_stop()

2022-10-12 Thread Yang Yingliang
After commit 571c05365892 ("drm/amdgpu: switch sdma buffer function tear down to a helper"), the variable 'ring' is not used anymore, it can be removed. Signed-off-by: Yang Yingliang --- drivers/gpu/drm/amd/amdgpu/si_dma.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/drivers/g

[PATCH -next] drm/amd/display: fix build error on arm64

2022-10-11 Thread Yang Yingliang
e_dsc" [drivers/gpu/drm/amd/amdgpu/amdgpu.ko] undefined! Fixes: 20dad3813b3c ("drm/amd/display: Add a helper to map ODM/MPC/Multi-Plane resources") Signed-off-by: Yang Yingliang --- drivers/gpu/drm/amd/display/dc/core/dc_resource.c | 4 1 file changed, 4 insertions(+) di

Re: [Freedreno] [PATCH -next] drm/msm/msm_gem_shrinker: fix compile error in can_block()

2022-09-29 Thread Yang Yingliang
Hi, On 2022/9/30 4:38, Rob Clark wrote: On Thu, Sep 29, 2022 at 4:51 AM Akhil P Oommen wrote: On 9/29/2022 3:00 PM, Yang Yingliang wrote: I got the compile error: drivers/gpu/drm/msm/msm_gem_shrinker.c: In function ‘can_block’: drivers/gpu/drm/msm/msm_gem_shrinker.c:29:21: error

[PATCH -next] drm/amdgpu/sdma: add missing release_firmware() in amdgpu_sdma_init_microcode()

2022-09-29 Thread Yang Yingliang
SDMA microcode") Signed-off-by: Yang Yingliang --- drivers/gpu/drm/amd/amdgpu/amdgpu_sdma.c | 8 +--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_sdma.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_sdma.c index 3949b7e3907f..43cf8632c

[PATCH -next] drm/msm/msm_gem_shrinker: fix compile error in can_block()

2022-09-29 Thread Yang Yingliang
xes: 025d27239a2f ("drm/msm/gem: Evict active GEM objects when necessary") Signed-off-by: Yang Yingliang --- drivers/gpu/drm/msm/msm_gem_shrinker.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/drm/msm/msm_gem_shrinker.c b/drivers/gpu/drm/msm/msm_gem_sh

[PATCH -next] drm/amd/display: change to enc314_stream_encoder_dp_blank static

2022-09-29 Thread Yang Yingliang
enc314_stream_encoder_dp_blank is only used in dcn314_dio_stream_encoder.c now, change it to static. Fixes: c9c2ff53cc20 ("drm/amd/display: Add explicit FIFO disable for DP blank") Signed-off-by: Yang Yingliang --- .../gpu/drm/amd/display/dc/dcn314/dcn314_dio_stream_encoder.c | 2

Re: [PATCH -next v3] backlight: gpio_backlight: Switch to use dev_err_probe() helper

2022-09-28 Thread Yang Yingliang
Hi, On 2022/9/28 17:11, Lee Jones wrote: On Tue, 27 Sep 2022, Daniel Thompson wrote: On Tue, Sep 27, 2022 at 11:31:38AM +0800, Yang Yingliang wrote: In the probe path, dev_err() can be replaced with dev_err_probe() which will check if error code is -EPROBE_DEFER and prints the error name

[PATCH -next v3] backlight: gpio_backlight: Switch to use dev_err_probe() helper

2022-09-26 Thread Yang Yingliang
In the probe path, dev_err() can be replaced with dev_err_probe() which will check if error code is -EPROBE_DEFER and prints the error name. It also sets the defer probe reason which can be checked later through debugfs. It's more simple in error path. Signed-off-by: Yang Yingliang --- v1 ->

Re: [PATCH -next v2] backlight: gpio_backlight: Switch to use dev_err_probe() helper

2022-09-26 Thread Yang Yingliang
Hi On 2022/9/26 23:32, Daniel Thompson wrote: On Mon, Sep 26, 2022 at 10:24:47PM +0800, Yang Yingliang wrote: In the probe path, dev_err() can be replaced with dev_err_probe() which will check if error code is -EPROBE_DEFER and prints the error name. It also sets the defer probe reason which

[PATCH -next resend] backlight: pwm_bl: Switch to use dev_err_probe() helper

2022-09-26 Thread Yang Yingliang
In the probe path, dev_err() can be replaced with dev_err_probe() which will check if error code is -EPROBE_DEFER and prints the error name. It also sets the defer probe reason which can be checked later through debugfs. It's more simple in error path. Signed-off-by: Yang Yingliang Reviewed

[PATCH -next v2] backlight: gpio_backlight: Switch to use dev_err_probe() helper

2022-09-26 Thread Yang Yingliang
In the probe path, dev_err() can be replaced with dev_err_probe() which will check if error code is -EPROBE_DEFER and prints the error name. It also sets the defer probe reason which can be checked later through debugfs. It's more simple in error path. Signed-off-by: Yang Yingliang --- v2

Re: [PATCH -next] backlight: gpio_backlight: Switch to use dev_err_probe() helper

2022-09-26 Thread Yang Yingliang
On 2022/9/26 21:46, Daniel Thompson wrote: On Mon, Sep 26, 2022 at 09:38:19PM +0800, Yang Yingliang wrote: In the probe path, dev_err() can be replaced with dev_err_probe() which will check if error code is -EPROBE_DEFER and prints the error name. It also sets the defer probe reason which can

[PATCH -next resend] backlight: ktd253: Switch to use dev_err_probe() helper

2022-09-26 Thread Yang Yingliang
In the probe path, dev_err() can be replaced with dev_err_probe() which will check if error code is -EPROBE_DEFER and prints the error name. It also sets the defer probe reason which can be checked later through debugfs. It's more simple in error path. Signed-off-by: Yang Yingliang Reviewed

Re: [PATCH -next] backlight: pwm_bl: Switch to use dev_err_probe() helper

2022-09-26 Thread Yang Yingliang
Hi, On 2022/9/26 21:41, Daniel Thompson wrote: On Mon, Sep 26, 2022 at 02:37:50PM +0100, Daniel Thompson wrote: On Mon, Sep 26, 2022 at 09:32:58PM +0800, Yang Yingliang wrote: In the probe path, dev_err() can be replaced with dev_err_probe() which will check if error code is -EPROBE_DEFER

[PATCH -next] backlight: gpio_backlight: Switch to use dev_err_probe() helper

2022-09-26 Thread Yang Yingliang
In the probe path, dev_err() can be replaced with dev_err_probe() which will check if error code is -EPROBE_DEFER and prints the error name. It also sets the defer probe reason which can be checked later through debugfs. It's more simple in error path. --- drivers/video/backlight/gpio_backlight.c

[PATCH -next] backlight: ktd253: Switch to use dev_err_probe() helper

2022-09-26 Thread Yang Yingliang
In the probe path, dev_err() can be replaced with dev_err_probe() which will check if error code is -EPROBE_DEFER and prints the error name. It also sets the defer probe reason which can be checked later through debugfs. It's more simple in error path. ---

[PATCH -next] backlight: pwm_bl: Switch to use dev_err_probe() helper

2022-09-26 Thread Yang Yingliang
In the probe path, dev_err() can be replaced with dev_err_probe() which will check if error code is -EPROBE_DEFER and prints the error name. It also sets the defer probe reason which can be checked later through debugfs. It's more simple in error path. --- drivers/video/backlight/pwm_bl.c | 5

[PATCH -next] drm/gma500: Fix wrong pointer passed to PTR_ERR()

2021-09-24 Thread Yang Yingliang
PTR_ERR() should access the value just tested by IS_ERR(), otherwise the wrong error code will be returned. Reported-by: Hulk Robot Signed-off-by: Yang Yingliang --- drivers/gpu/drm/gma500/psb_drv.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/drm/gma500

[PATCH 1/2] drm/nouveau/kms/nv50-: fix file release memory leak

2021-09-11 Thread Yang Yingliang
When using single_open() for opening, single_release() should be called, otherwise the 'op' allocated in single_open() will be leaked. Fixes: 12885ecbfe62 ("drm/nouveau/kms/nvd9-: Add CRC support") Reported-by: Hulk Robot Signed-off-by: Yang Yingliang --- drivers/gpu/drm/nouveau/disp

[PATCH 2/2] drm/nouveau/debugfs: fix file release memory leak

2021-09-11 Thread Yang Yingliang
When using single_open() for opening, single_release() should be called, otherwise the 'op' allocated in single_open() will be leaked. Fixes: 6e9fc177399f ("drm/nouveau/debugfs: add copy of sysfs pstate interface ported to debugfs") Reported-by: Hulk Robot Signed-off-by: Yang

[PATCH -next] drm/i915: pass correct pointer to PTR_ERR()

2021-08-16 Thread Yang Yingliang
The 'obj' is tested by IS_ERR(), we should pass it to PTR_ERR(). Signed-off-by: Yang Yingliang --- drivers/gpu/drm/i915/gem/selftests/i915_gem_dmabuf.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/i915/gem/selftests/i915_gem_dmabuf.c b/drivers/gpu/drm

[PATCH -next v2 resend] drm/bochs: Fix missing pci_disable_device() on error in bochs_pci_probe()

2021-07-15 Thread Yang Yingliang
Replace pci_enable_device() with pcim_enable_device(), pci_disable_device() will be called in release automatically. v2: use pcim_enable_device() Signed-off-by: Yang Yingliang Reported-by: Hulk Robot Acked-by: Thomas Zimmermann --- drivers/gpu/drm/bochs/bochs_drv.c | 2 +- 1 file changed

Re: [PATCH -next v2] drm/bochs: Fix missing pci_disable_device() on error in bochs_pci_probe()

2021-07-15 Thread Yang Yingliang
On 2021/7/15 17:30, Thomas Zimmermann wrote: Hi, for the change Acked-by: Thomas Zimmermann but there are some style issues AFAICS. OK, need I resend it with the style changes and your ack ? Am 15.07.21 um 04:05 schrieb Yang Yingliang: Replace pci_enable_device

[PATCH -next v2] drm/bochs: Fix missing pci_disable_device() on error in bochs_pci_probe()

2021-07-14 Thread Yang Yingliang
Replace pci_enable_device() with pcim_enable_device(), pci_disable_device() will be called in release automatically. Reported-by: Hulk Robot Signed-off-by: Yang Yingliang --- v2: use pcim_enable_device() --- drivers/gpu/drm/tiny/bochs.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion

[PATCH -next] drm/bochs: Fix missing pci_disable_device() on error in bochs_pci_probe()

2021-07-14 Thread Yang Yingliang
Fix the missing pci_disable_device() before return from bochs_pci_probe() in the error handling case. Reported-by: Hulk Robot Signed-off-by: Yang Yingliang --- drivers/gpu/drm/tiny/bochs.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/gpu/drm/tiny/bochs.c b/drivers/gpu/drm/tiny

[PATCH -next] drm/amdgpu: Fix missing unlock on error in amdgpu_ras_debugfs_table_read()

2021-07-04 Thread Yang Yingliang
Add the missing unlock before return from function amdgpu_ras_debugfs_table_read() in the error handling case. Fixes: 9b790694a031 ("drm/amdgpu: RAS EEPROM table is now in debugfs") Reported-by: Hulk Robot Signed-off-by: Yang Yingliang --- drivers/gpu/drm/amd/amdgpu/amdgpu_ras_ee

[PATCH -next] drm/rockchip: cdn-dp-core: add missing clk_disable_unprepare() on error in cdn_dp_grf_write()

2021-05-19 Thread Yang Yingliang
After calling clk_prepare_enable(), clk_disable_unprepare() need be called when calling regmap_write() failed. Fixes: 1a0f7ed3abe2 ("drm/rockchip: cdn-dp: add cdn DP support for rk3399") Reported-by: Hulk Robot Signed-off-by: Yang Yingliang --- drivers/gpu/drm/rockchip/cdn-dp-core.

[PATCH -next 2/4] drm/radeon: correct function name radeon_cs_parser_fini()

2021-05-13 Thread Yang Yingliang
Fix the following make W=1 kernel build warning: drivers/gpu/drm/radeon/radeon_cs.c:417: warning: expecting prototype for cs_parser_fini(). Prototype was for radeon_cs_parser_fini() instead Signed-off-by: Yang Yingliang --- drivers/gpu/drm/radeon/radeon_cs.c | 2 +- 1 file changed, 1

[PATCH -next] drm: correct function name drm_legacy_ctxbitmap_flush()

2021-05-13 Thread Yang Yingliang
Fix the following make W=1 kernel build warning: drivers/gpu/drm/drm_context.c:136: warning: expecting prototype for drm_ctxbitmap_flush(). Prototype was for drm_legacy_ctxbitmap_flush() instead Signed-off-by: Yang Yingliang --- drivers/gpu/drm/drm_context.c | 2 +- 1 file changed, 1

[PATCH -next 4/4] drm/radeon/radeon_vm: correct function names in radeon_vm.c

2021-05-13 Thread Yang Yingliang
(). Prototype was for radeon_vm_update_page_directory() instead Signed-off-by: Yang Yingliang --- drivers/gpu/drm/radeon/radeon_vm.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/radeon/radeon_vm.c b/drivers/gpu/drm/radeon/radeon_vm.c index 2dc9c9f98049

[PATCH -next 1/4] drm/radeon/cik: correct function name cik_irq_suspend()

2021-05-13 Thread Yang Yingliang
Fix the following make W=1 kernel build warning: drivers/gpu/drm/radeon/cik.c:7450: warning: expecting prototype for cik_irq_disable(). Prototype was for cik_irq_suspend() instead Signed-off-by: Yang Yingliang --- drivers/gpu/drm/radeon/cik.c | 2 +- 1 file changed, 1 insertion(+), 1

[PATCH -next 0/4] drm/radeon: fix some doc-warnings

2021-05-13 Thread Yang Yingliang
Yang Yingliang (4): drm/radeon/cik: correct function name cik_irq_suspend() drm/radeon: correct function name radeon_cs_parser_fini() drm/radeon/r100: correct function name r100_cs_packet_parse_vline() drm/radeon/radeon_vm: correct function names in radeon_vm.c drivers/gpu/drm/radeon

[PATCH -next 3/4] drm/radeon/r100: correct function name r100_cs_packet_parse_vline()

2021-05-13 Thread Yang Yingliang
Fix the following make W=1 kernel build warning: drivers/gpu/drm/radeon/r100.c:1423: warning: expecting prototype for r100_cs_packet_next_vline(). Prototype was for r100_cs_packet_parse_vline() instead Signed-off-by: Yang Yingliang --- drivers/gpu/drm/radeon/r100.c | 2 +- 1 file changed

[PATCH] drm/omap: dmm_tiler: fix return error code in omap_dmm_probe()

2020-11-17 Thread Yang Yingliang
Return -ENOMEM when allocating refill memory failed. Fixes: 71e8831f6407 ("drm/omap: DMM/TILER support for OMAP4+ platform") Reported-by: Hulk Robot Signed-off-by: Yang Yingliang --- drivers/gpu/drm/omapdrm/omap_dmm_tiler.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drive

[PATCH] drm/panel: add missing platform_driver_unregister() on error path

2020-11-10 Thread Yang Yingliang
If mipi_dsi_driver_register() failed, platform_driver_unregister() need be called. Fixes: 210fcd9d9cf1 ("drm/panel: Add support for Panasonic VVX10F004B0") Reported-by: Hulk Robot Signed-off-by: Yang Yingliang --- drivers/gpu/drm/panel/panel-simple.c | 4 +++- 1 file changed, 3

[PATCH resend] vgacon: fix a UAF in do_update_region()

2020-10-21 Thread Yang Yingliang
and vga_vram_end. But we still use vc_screenbuf_size, if the vga_vram_size is smaller than vc_screenbuf_size, vc_pos may be out of bound, using it will cause a use-after-free(or out-of-bounds). Fix this by calling vc_resize() if vga_vram_size is smaller than vc_screenbuf_size. Signed-off-by: Yang Yingliang

Re: [PATCH resend] vgacon: fix a UAF in do_update_region()

2020-10-21 Thread Yang Yingliang
20002078 = 0; *(uint64_t*)0x20002080 = 0; *(uint64_t*)0x20002088 = 0; *(uint64_t*)0x20002090 = 0; *(uint64_t*)0x20002098 = 0; *(uint64_t*)0x200020a0 = 0; *(uint64_t*)0x200020a8 = 0; *(uint64_t*)0x200020b0 = 0;     syscall(__NR_write, r[3], 0x2840ul, 0x1878ul);     return 0; } On 2020/10/20 17:02, Y

Re: [PATCH] vgacon: Fix an out-of-bounds in vgacon_scrollback_update()

2020-07-31 Thread Yang Yingliang
On 2020/7/30 19:04, Jiri Slaby wrote: On 13. 07. 20, 12:57, Yang Yingliang wrote: I got a slab-out-of-bounds report when I doing fuzz test. [ 334.989515] == [ 334.989577] BUG: KASAN: slab-out-of-bounds in vgacon_scroll+0x57a

Re: [PATCH] vgacon: Fix an out-of-bounds in vgacon_scrollback_update()

2020-07-31 Thread Yang Yingliang
On 2020/7/30 21:38, Jiri Slaby wrote: On 30. 07. 20, 15:24, Yang Yingliang wrote: On 2020/7/30 19:04, Jiri Slaby wrote: On 13. 07. 20, 12:57, Yang Yingliang wrote: I got a slab-out-of-bounds report when I doing fuzz test. [  334.989515

[PATCH] vgacon: fix a UAF in do_update_region()

2020-07-14 Thread Yang Yingliang
and vga_vram_end. But we still use vc_screenbuf_size, if the vga_vram_size is smaller than vc_screenbuf_size, vc_pos may be out of bound, using it will cause a use-after-free(or out-of-bounds). Fix this by calling vc_resize() if vga_vram_size is smaller than vc_screenbuf_size. Signed-off-by: Yang Yingliang

[PATCH] vgacon: Fix an out-of-bounds in vgacon_scrollback_update()

2020-07-14 Thread Yang Yingliang
gt;tail plus memcpy size is greater than vgacon_scrollback_cur->size. Fix this by checking the memcpy size. Reported-by: Hulk Robot Signed-off-by: Yang Yingliang --- drivers/video/console/vgacon.c | 11 --- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/drivers/video/con