[PATCH] drm/modes: Fix unterminated strncpy

2019-07-30 Thread Chuhong Yuan
strncpy(dest, src, strlen(src)) leads to unterminated dest, which is dangerous. Fix it by using strscpy. Signed-off-by: Chuhong Yuan --- drivers/gpu/drm/drm_modes.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/drm/drm_modes.c b/drivers/gpu/drm/drm_modes.c

[PATCH v2] drm/modes: Fix unterminated strncpy

2019-07-30 Thread Chuhong Yuan
strncpy(dest, src, strlen(src)) leads to unterminated dest, which is dangerous. Fix it by using strscpy. Signed-off-by: Chuhong Yuan --- Changes in v2: - Check whether mode_end + 1 exceeds the size of mode->name. drivers/gpu/drm/drm_modes.c | 4 +++- 1 file changed, 3 inserti

[PATCH] drm/bochs: Use dev_get_drvdata

2019-07-23 Thread Chuhong Yuan
Instead of using to_pci_dev + pci_get_drvdata, use dev_get_drvdata to make code simpler. Signed-off-by: Chuhong Yuan --- drivers/gpu/drm/bochs/bochs_drv.c | 6 ++ 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/gpu/drm/bochs/bochs_drv.c b/drivers/gpu/drm/bochs

[PATCH] drm/ast: Use dev_get_drvdata where possible

2019-07-23 Thread Chuhong Yuan
Instead of using to_pci_dev + pci_get_drvdata, use dev_get_drvdata to make code simpler. Signed-off-by: Chuhong Yuan --- drivers/gpu/drm/ast/ast_drv.c | 12 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/drivers/gpu/drm/ast/ast_drv.c b/drivers/gpu/drm/ast/ast_drv.c

[PATCH] drm/hisilicon: Use dev_get_drvdata

2019-07-23 Thread Chuhong Yuan
Instead of using to_pci_dev + pci_get_drvdata, use dev_get_drvdata to make code simpler. Signed-off-by: Chuhong Yuan --- drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_drv.c | 6 ++ 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_drv.c b

[PATCH] drm/qxl: Use dev_get_drvdata where possible

2019-07-23 Thread Chuhong Yuan
Instead of using to_pci_dev + pci_get_drvdata, use dev_get_drvdata to make code simpler. Signed-off-by: Chuhong Yuan --- drivers/gpu/drm/qxl/qxl_drv.c | 6 ++ 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/gpu/drm/qxl/qxl_drv.c b/drivers/gpu/drm/qxl/qxl_drv.c index

[PATCH] drm/i915: Use dev_get_drvdata

2019-07-23 Thread Chuhong Yuan
Instead of using to_pci_dev + pci_get_drvdata, use dev_get_drvdata to make code simpler. Signed-off-by: Chuhong Yuan --- drivers/gpu/drm/i915/i915_drv.c | 12 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/drivers/gpu/drm/i915/i915_drv.c b/drivers/gpu/drm/i915

[PATCH] drm/exynos: Use dev_get_drv_data

2019-07-19 Thread Chuhong Yuan
dev_get_drvdata is a simpler implementation comparing to to_platform_device + platform_get_drvdata. This makes the code simpler. Signed-off-by: Chuhong Yuan --- drivers/gpu/drm/exynos/exynos_drm_fimc.c | 2 +- drivers/gpu/drm/exynos/exynos_drm_gsc.c | 2 +- 2 files changed, 2 insertions(+), 2

[PATCH] drm/amd/display: Use dev_get_drvdata

2019-07-23 Thread Chuhong Yuan
Instead of using to_pci_dev + pci_get_drvdata, use dev_get_drvdata to make code simpler. Signed-off-by: Chuhong Yuan --- drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c b

[PATCH] drm/radeon: Use dev_get_drvdata where possible

2019-07-23 Thread Chuhong Yuan
Instead of using to_pci_dev + pci_get_drvdata, use dev_get_drvdata to make code simpler. Signed-off-by: Chuhong Yuan --- drivers/gpu/drm/radeon/radeon_drv.c | 15 +-- 1 file changed, 5 insertions(+), 10 deletions(-) diff --git a/drivers/gpu/drm/radeon/radeon_drv.c b/drivers/gpu

[PATCH] drm/amdgpu: Use dev_get_drvdata where possible

2019-07-23 Thread Chuhong Yuan
Instead of using to_pci_dev + pci_get_drvdata, use dev_get_drvdata to make code simpler. Signed-off-by: Chuhong Yuan --- drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c | 27 + 1 file changed, 10 insertions(+), 17 deletions(-) diff --git a/drivers/gpu/drm/amd/amdgpu

[PATCH] drm/vmwgfx: Use dev_get_drvdata

2019-07-23 Thread Chuhong Yuan
Instead of using to_pci_dev + pci_get_drvdata, use dev_get_drvdata to make code simpler. Signed-off-by: Chuhong Yuan --- drivers/gpu/drm/vmwgfx/vmwgfx_drv.c | 6 ++ 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_drv.c b/drivers/gpu/drm/vmwgfx

[PATCH] drm/nouveau: Use dev_get_drvdata where possible

2019-07-23 Thread Chuhong Yuan
Instead of using to_pci_dev + pci_get_drvdata, use dev_get_drvdata to make code simpler. Signed-off-by: Chuhong Yuan --- drivers/gpu/drm/nouveau/nouveau_drm.c | 6 ++ 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/gpu/drm/nouveau/nouveau_drm.c b/drivers/gpu/drm

[PATCH] drm/gma500: Use dev_get_drvdata where possible

2019-07-23 Thread Chuhong Yuan
Instead of using to_pci_dev + pci_get_drvdata, use dev_get_drvdata to make code simpler. Signed-off-by: Chuhong Yuan --- drivers/gpu/drm/gma500/power.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/drm/gma500/power.c b/drivers/gpu/drm/gma500/power.c index

[PATCH] video: fbdev: aty: Use dev_get_drvdata

2019-07-24 Thread Chuhong Yuan
Instead of using to_pci_dev + pci_get_drvdata, use dev_get_drvdata to make code simpler. Signed-off-by: Chuhong Yuan --- drivers/video/fbdev/aty/radeon_base.c | 6 ++ 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/video/fbdev/aty/radeon_base.c b/drivers/video/fbdev

[PATCH] fbdev: sm712fb: Use dev_get_drvdata

2019-07-25 Thread Chuhong Yuan
Instead of using to_pci_dev + pci_get_drvdata, use dev_get_drvdata to make code simpler. Signed-off-by: Chuhong Yuan --- drivers/video/fbdev/sm712fb.c | 8 ++-- 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/drivers/video/fbdev/sm712fb.c b/drivers/video/fbdev/sm712fb.c index

[PATCH] gpu: ipu-v3: prg: add missed clk_disable_unprepare in remove

2019-11-01 Thread Chuhong Yuan
The driver forgets to disable and unprepare clks when remove. Add the calls to clk_disable_unprepare to fix the problem. Signed-off-by: Chuhong Yuan --- drivers/gpu/ipu-v3/ipu-prg.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/gpu/ipu-v3/ipu-prg.c b/drivers/gpu/ipu-v3/ipu-prg.c

[PATCH] drm/virtgpu: fix double unregistration

2019-11-10 Thread Chuhong Yuan
drm_put_dev also calls drm_dev_unregister, so dev will be unregistered twice. Replace it with drm_dev_put to fix it. Signed-off-by: Chuhong Yuan --- drivers/gpu/drm/virtio/virtgpu_drv.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/drm/virtio/virtgpu_drv.c b

[PATCH] backlight: lp855x: disable enable regulator when remove

2019-11-01 Thread Chuhong Yuan
lp855x forgets to disable enable regulator when remove. Add a call to regulator_disable in remove just like what is done to supply regulator. Signed-off-by: Chuhong Yuan --- drivers/video/backlight/lp855x_bl.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/video/backlight

Re: [PATCH] drm/virtgpu: fix double unregistration

2019-11-12 Thread Chuhong Yuan
On Tue, Nov 12, 2019 at 5:40 PM Daniel Vetter wrote: > > On Sat, Nov 09, 2019 at 03:54:17PM +0800, Chuhong Yuan wrote: > > drm_put_dev also calls drm_dev_unregister, so dev will be unregistered > > twice. > > Replace it with drm_dev_put to fix it. > > > > S

[PATCH] video: fbdev: arcfb: add missed free_irq

2019-11-17 Thread Chuhong Yuan
The driver forgets to free irq in remove which is requested in probe. Add the missed call to fix it. Signed-off-by: Chuhong Yuan --- drivers/video/fbdev/arcfb.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/video/fbdev/arcfb.c b/drivers/video/fbdev/arcfb.c index a48741aab240

[PATCH] video: fbdev: vesafb: add missed release_region

2019-11-17 Thread Chuhong Yuan
This driver calls request_region in probe but forgets to call release_region in probe failure and remove. Add the missed calls to fix it. Signed-off-by: Chuhong Yuan --- drivers/video/fbdev/vesafb.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/video/fbdev/vesafb.c b/drivers

[PATCH] fbdev: s1d13xxxfb: add missed unregister_framebuffer in remove

2019-11-18 Thread Chuhong Yuan
The driver calls register_framebuffer in probe but does not call unregister_framebuffer in remove. Add the missed call to fix it. Signed-off-by: Chuhong Yuan --- drivers/video/fbdev/s1d13xxxfb.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/video/fbdev/s1d13xxxfb.c b/drivers/video

[PATCH] drm/v3d: add missed pm_runtime_disable

2019-11-18 Thread Chuhong Yuan
The driver forgets to call pm_runtime_disable in probe failure and remove. Add the missed calls to fix it. Signed-off-by: Chuhong Yuan --- drivers/gpu/drm/v3d/v3d_drv.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/gpu/drm/v3d/v3d_drv.c b/drivers/gpu/drm/v3d/v3d_drv.c index

[PATCH v2] gpu: ipu-v3: prg: add missed operations in remove

2019-11-18 Thread Chuhong Yuan
This driver forgets to call pm_runtime_disable and clk_disable_unprepare in remove. Add the calls to fix it. Signed-off-by: Chuhong Yuan --- Changes in v2: - Add the missed pm_runtime_disable. drivers/gpu/ipu-v3/ipu-prg.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/gpu/ipu

[PATCH] drm/gma500: add a missed gma_power_end in error path

2019-12-09 Thread Chuhong Yuan
oaktrail_lvds_mode_set() misses a gma_power_end() in an error path. Add the call to fix it. Signed-off-by: Chuhong Yuan --- drivers/gpu/drm/gma500/oaktrail_lvds.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/gpu/drm/gma500/oaktrail_lvds.c b/drivers/gpu/drm/gma500/oaktrail_lvds.c

[PATCH v2] drm/nouveau/dispnv50: add missed nv50_outp_release in nv50_msto_disable

2019-12-13 Thread Chuhong Yuan
nv50_msto_disable() does not call nv50_outp_release() to match nv50_outp_acquire() like other disable(). Add the missed call to fix it. Signed-off-by: Chuhong Yuan --- Changes in v2: - Fix the subject prefix. drivers/gpu/drm/nouveau/dispnv50/disp.c | 4 +++- 1 file changed, 3 insertions

[PATCH resend] drm/exynos: gsc: add missed component_del

2019-12-06 Thread Chuhong Yuan
The driver forgets to call component_del in remove to match component_add in probe. Add the missed call to fix it. Signed-off-by: Chuhong Yuan --- drivers/gpu/drm/exynos/exynos_drm_gsc.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/gpu/drm/exynos/exynos_drm_gsc.c b/drivers/gpu

[PATCH] pxa168fb: fix release function mismatch in probe failure

2019-12-06 Thread Chuhong Yuan
The driver uses kfree() to release the resource allocated by framebuffer_alloc(), which does not match. Use framebuffer_release() instead to fix it. Fixes: 638772c7553f ("fb: add support of LCD display controller on pxa168/910 (base layer)") Signed-off-by: Chuhong Yuan --- drivers/v

[PATCH] drm/dp_mst: add missed nv50_outp_release in nv50_msto_disable

2019-12-06 Thread Chuhong Yuan
nv50_msto_disable() does not call nv50_outp_release() to match nv50_outp_acquire() like other disable(). Add the missed call to fix it. Signed-off-by: Chuhong Yuan --- drivers/gpu/drm/nouveau/dispnv50/disp.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm

[PATCH v2] video: fbdev: vesafb: add missed release_region

2019-12-06 Thread Chuhong Yuan
The driver forgets to free the requested irq in remove and probe failure. Add the missed calls to fix it. Signed-off-by: Chuhong Yuan --- Changes in v2: - Modify commit message. drivers/video/fbdev/vesafb.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/video/fbdev/vesafb.c b

[PATCH] video: ssd1307fb: add the missed regulator_disable

2019-11-19 Thread Chuhong Yuan
The driver forgets to disable the regulator in remove like what is done in probe failure. Add the missed call to fix it. Signed-off-by: Chuhong Yuan --- drivers/video/fbdev/ssd1307fb.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/video/fbdev/ssd1307fb.c b/drivers/video/fbdev

[PATCH] drm/exynos: gsc: add missed component_del

2019-11-19 Thread Chuhong Yuan
The driver forgets to call component_del in remove to match component_add in probe. Add the missed call to fix it. Signed-off-by: Chuhong Yuan --- drivers/gpu/drm/exynos/exynos_drm_gsc.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/gpu/drm/exynos/exynos_drm_gsc.c b/drivers/gpu

[PATCH v3] video: fbdev: vesafb: add missed release_region

2020-03-10 Thread Chuhong Yuan
The driver forgets to free the I/O region in remove and probe failure. Add the missed calls to fix it. Signed-off-by: Chuhong Yuan --- Changes in v3: - Revise the commit message. - Add an error handler to suit the "goto error" before request_region(). - Revise the order of

[PATCH v2] video: fbdev: arcfb: add missed free_irq and fix the order of request_irq

2020-03-10 Thread Chuhong Yuan
The driver forgets to free irq in remove which is requested in probe. Add the missed call to fix it. Also, the position of request_irq() in probe should be put before register_framebuffer(). Signed-off-by: Chuhong Yuan --- Changes in v2: - Modify the commit message. - Adjust the order

[PATCH v2] fbdev: s1d13xxxfb: add missed unregister_framebuffer in remove

2020-03-10 Thread Chuhong Yuan
The driver calls register_framebuffer() in probe but does not call unregister_framebuffer() in remove. Rename current remove to __s1d13xxxfb_remove() for error handler. Then add a new remove to call unregister_framebuffer(). Signed-off-by: Chuhong Yuan --- Changes in v2: - Rename the existing

[PATCH v3] video: fbdev: arcfb: add missed free_irq and fix the order of request_irq

2020-03-10 Thread Chuhong Yuan
The driver forgets to free irq in remove which is requested in probe. Add the missed call to fix it. Also, the position of request_irq() in probe should be put before register_framebuffer(). Signed-off-by: Chuhong Yuan --- Changes in v3: - Add missed variable par in remove. drivers/video

[PATCH v4] video: fbdev: vesafb: add missed release_region

2020-03-30 Thread Chuhong Yuan
on" is not null. Signed-off-by: Chuhong Yuan --- Changes in v4: - Add a field in vesafb_par to represent whether request_region() succeeds. - Only call release_region() when request_region() succeeds. - Adjust the order in the error handler of probe. - Modify commit message. drivers/

[PATCH v3] fbdev: s1d13xxxfb: add missed unregister_framebuffer in remove

2020-03-25 Thread Chuhong Yuan
The driver calls register_framebuffer() in probe but does not call unregister_framebuffer() in remove. Rename current remove to __s1d13xxxfb_remove() for error handler. Then add a new remove to call unregister_framebuffer(). Signed-off-by: Chuhong Yuan --- Changes in v3: - Fix code style

Re: [PATCH v3] video: fbdev: vesafb: add missed release_region

2020-03-25 Thread Chuhong Yuan
On Fri, Mar 20, 2020 at 8:01 PM Bartlomiej Zolnierkiewicz wrote: > > > On 3/10/20 3:35 AM, Chuhong Yuan wrote: > > The driver forgets to free the I/O region in remove and probe > > failure. > > Add the missed calls to fix it. > > > > Signed-off-by:

[PATCH v4] video: fbdev: arcfb: add missed free_irq and fix the order of request_irq

2020-03-25 Thread Chuhong Yuan
The driver forgets to free irq in remove which is requested in probe. Add the missed call to fix it. Also, the position of request_irq() in probe should be put before register_framebuffer(). Signed-off-by: Chuhong Yuan --- Changes in v4: - Use info->par->irq instead of par->irq

[PATCH v2] fbdev: geode: Add the missed pci_disable_device() in gx1fb_map_video_memory()

2020-06-07 Thread Chuhong Yuan
Although gx1fb_probe() has handled the failure of gx1fb_map_video_memory() partly, it does not call pci_disable_device() as gx1fb_map_video_memory() calls pci_enable_device(). Add the missed function call to fix the bug. Fixes: 53eed4ec8bcd ("[PATCH] fbdev: geode updates]") Signed-off-b

[PATCH] fbdev: geocode: Add the missed pci_disable_device() for gx1fb_map_video_memory()

2020-06-04 Thread Chuhong Yuan
Although gx1fb_probe() has handled the failure of gx1fb_map_video_memory() partly, it does not call pci_disable_device() as gx1fb_map_video_memory() calls pci_enable_device(). Add the missed function call to fix the bug. Fixes: 53eed4ec8bcd ("[PATCH] fbdev: geode updates]") Signed-off-b

[PATCH] drm/fb-helper: Add missed unlocks in setcmap_legacy()

2020-12-04 Thread Chuhong Yuan
setcmap_legacy() does not call drm_modeset_unlock_all() in some exits, add the missed unlocks with goto to fix it. Fixes: 964c60063bff ("drm/fb-helper: separate the fb_setcmap helper into atomic and legacy paths") Signed-off-by: Chuhong Yuan --- drivers/gpu/drm/drm_fb_hel