[PATCH] drm/vc4: Fix refcount leak in vc4_hvs_bind

2022-12-20 Thread Miaoqian Lin
rpi_firmware_get() takes refcount, we should release it with rpi_firmware_put(), add missing rpi_firmware_put() in the error path. Fixes: 2a001ca00ad5 ("drm/vc4: hdmi: Rework hdmi_enable_4kp60 detection code") Signed-off-by: Miaoqian Lin --- drivers/gpu/drm/vc4/vc4_hvs.c | 1 + 1 fi

[PATCH] backlight: backlight: Fix doc for backlight_device_get_by_name

2022-12-14 Thread Miaoqian Lin
backlight_put() has been dropped, we should call put_device() to drop the reference taken by backlight_device_get_by_name(). Fixes: 0f6a3256fd81 ("backlight: backlight: Drop backlight_put()") Signed-off-by: Miaoqian Lin --- drivers/video/backlight/backlight.c | 2 +- 1 file changed, 1

[PATCH] drm/i915: Fix documentation for intel_uncore_forcewake_put__locked

2022-12-07 Thread Miaoqian Lin
intel_uncore_forcewake_put__locked() is used to release a reference. Fixes: a6111f7b6604 ("drm/i915: Reduce locking in execlist command submission") Signed-off-by: Miaoqian Lin --- drivers/gpu/drm/i915/intel_uncore.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)

[PATCH v2] drm/msm/dpu: Fix memory leak in msm_mdss_parse_data_bus_icc_path

2022-12-06 Thread Miaoqian Lin
of_icc_get() alloc resources for path1, we should release it when not need anymore. Early return when IS_ERR_OR_NULL(path0) may leak path1. Defer getting path1 to fix this. Fixes: b9364eed9232 ("drm/msm/dpu: Move min BW request and full BW disable back to mdss") Signed-off-by: Mi

[PATCH] drm/msm/dpu: Fix memory leak in msm_mdss_parse_data_bus_icc_path

2022-12-05 Thread Miaoqian Lin
Signed-off-by: Miaoqian Lin --- drivers/gpu/drm/msm/msm_mdss.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/msm/msm_mdss.c b/drivers/gpu/drm/msm/msm_mdss.c index e13c5c12b775..a38fa9a9a3d6 100644 --- a/drivers/gpu/drm/msm/msm_mdss.c +++ b/drivers/gpu/drm/msm/

Re: [PATCH] drm/msm/mdp4: Fix refcount leak in mdp4_modeset_init_intf

2022-06-14 Thread Miaoqian Lin
Hi, Abhinav On 2022/6/11 7:20, Abhinav Kumar wrote: > > > On 6/7/2022 4:08 AM, Miaoqian Lin wrote: >> of_graph_get_remote_node() returns remote device node pointer with >> refcount incremented, we should use of_node_put() on it >> when not need anymore. >> A

[PATCH] drm/msm/mdp4: Fix refcount leak in mdp4_modeset_init_intf

2022-06-07 Thread Miaoqian Lin
of_graph_get_remote_node() returns remote device node pointer with refcount incremented, we should use of_node_put() on it when not need anymore. Add missing of_node_put() to avoid refcount leak. Fixes: 86418f90a4c1 ("drm: convert drivers to use of_graph_get_remote_node") Signed-off-by

[PATCH v2] drm/tegra: dc: rgb: Fix refcount leak in tegra_dc_rgb_probe

2022-06-03 Thread Miaoqian Lin
of_get_child_by_name() returns a node pointer with refcount incremented, we should use of_node_put() on it when not need anymore. So add of_node_put() in error paths. Fixes: d8f4a9eda006 ("drm: Add NVIDIA Tegra20 support") Signed-off-by: Miaoqian Lin --- changes in v2: - update Fix

[PATCH] drm/tegra: dc: rgb: Fix refcount leak in tegra_dc_rgb_probe

2022-06-02 Thread Miaoqian Lin
of_get_child_by_name() returns a node pointer with refcount incremented, we should use of_node_put() on it when not need anymore. So add of_node_put() in error paths. Fixes: format:d8f4a9eda006 ("drm: Add NVIDIA Tegra20 support") Signed-off-by: Miaoqian Lin --- drivers/gpu/drm/tegra/

[PATCH v2] drm/virtio: Fix NULL vs IS_ERR checking in virtio_gpu_object_shmem_init

2022-06-02 Thread Miaoqian Lin
Signed-off-by: Miaoqian Lin --- changes in v2: - Update Fixes tag. - rebase the working tree. v1 Link: https://lore.kernel.org/all/20211222072649.18169-1-linmq...@gmail.com/ --- drivers/gpu/drm/virtio/virtgpu_object.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/

[PATCH v4] drm/v3d/v3d_drv: Fix PM disable depth imbalance

2022-06-01 Thread Miaoqian Lin
The pm_runtime_enable will increase power disable depth. We need to call pm_runtime_disable() to balance it when needed use devm_pm_runtime_enable() and handle it automatically/ Fixes: 57692c94dcbe ("drm/v3d: Introduce a new DRM driver for Broadcom V3D V3.x+") Signed-off-by: Mi

Re: [PATCH v3] drm/v3d/v3d_drv: Fix PM disable depth imbalance

2022-06-01 Thread Miaoqian Lin
Hi, Thierry On 2022/6/1 22:47, Thierry Reding wrote: > On Wed, Jun 01, 2022 at 09:55:02PM +0800, Miaoqian Lin wrote: >> Hi, Daniel >> >> On 2022/6/1 21:26, Daniel Vetter wrote: >>> On Wed, Jun 01, 2022 at 04:20:50PM +0400, Miaoqian Lin wrote: >>>> The pm_

Re: [PATCH v3] drm/v3d/v3d_drv: Fix PM disable depth imbalance

2022-06-01 Thread Miaoqian Lin
Hi, Daniel On 2022/6/1 21:26, Daniel Vetter wrote: > On Wed, Jun 01, 2022 at 04:20:50PM +0400, Miaoqian Lin wrote: >> The pm_runtime_enable will increase power disable depth. >> If the probe fails, we should use pm_runtime_disable() to balance >> pm_runtime_enable(). >>

[RESEND PATCH] drm/mipi-dsi: Fix error handling in mipi_dsi_device_register_full

2022-06-01 Thread Miaoqian Lin
In mipi_dsi_device_alloc(), it calls device_initialize(>dev); We need to use put_device() instead freeing directly. Fixes: 068a002 ("drm: Add MIPI DSI bus support") Signed-off-by: Miaoqian Lin --- drivers/gpu/drm/drm_mipi_dsi.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-

[PATCH v3] drm/v3d/v3d_drv: Fix PM disable depth imbalance

2022-06-01 Thread Miaoqian Lin
Signed-off-by: Miaoqian Lin --- Changes in v3: - call pm_runtime_disable() in v3d_platform_drm_remove - update commit message Changes in v2 - put pm_runtime_disable before dma_free_wc - rename dma_free to pm_disable v1: https://lore.kernel.org/r/20220105120442.14418-1-linmq...@gmail.com v2: https://lore.ke

[PATCH v2 2/2] drm/meson: encoder_hdmi: Fix refcount leak in meson_encoder_hdmi_init

2022-05-31 Thread Miaoqian Lin
of_graph_get_remote_node() returns remote device nodepointer with refcount incremented, we should use of_node_put() on it when done. Add missing of_node_put() to avoid refcount leak. Fixes: e67f6037ae1b ("drm/meson: split out encoder from meson_dw_hdmi") Signed-off-by: Miaoqian Lin -

[PATCH v2 1/2] drm/meson: encoder_cvbs: Fix refcount leak in meson_encoder_cvbs_init

2022-05-31 Thread Miaoqian Lin
Signed-off-by: Miaoqian Lin --- drivers/gpu/drm/meson/meson_encoder_cvbs.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/gpu/drm/meson/meson_encoder_cvbs.c b/drivers/gpu/drm/meson/meson_encoder_cvbs.c index fd8db97ba8ba..8110a6e39320 100644 --- a/drivers/gpu/drm/meson/meson_encoder_cvbs.c +++

[PATCH v2 0/2] drm/meson: Fix refcount leak

2022-05-31 Thread Miaoqian Lin
by Martin Blumenstingl (patch#1: no changes since v1) v1 link: patch#1: https://lore.kernel.org/r/20220531144818.26943-1-linmq...@gmail.com/ patch#2: https://lore.kernel.org/r/20220531144818.26943-2-linmq...@gmail.com/ Miaoqian Lin (2): drm/meson: encoder_cvbs: Fix refcount leak

[PATCH 2/2] drm/meson: encoder_hdmi: Fix refcount leak in meson_encoder_hdmi_init

2022-05-31 Thread Miaoqian Lin
of_graph_get_remote_node() returns remote device nodepointer with refcount incremented, we should use of_node_put() on it when done. Add missing of_node_put() to avoid refcount leak. Fixes: e67f6037ae1b ("drm/meson: split out encoder from meson_dw_hdmi") Signed-off-by: Miaoqian Lin --

[PATCH 1/2] drm/meson: encoder_cvbs: Fix refcount leak in meson_encoder_cvbs_init

2022-05-31 Thread Miaoqian Lin
Signed-off-by: Miaoqian Lin --- drivers/gpu/drm/meson/meson_encoder_cvbs.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/gpu/drm/meson/meson_encoder_cvbs.c b/drivers/gpu/drm/meson/meson_encoder_cvbs.c index fd8db97ba8ba..8110a6e39320 100644 --- a/drivers/gpu/drm/meson/meson_encoder_cvbs.c +++

[PATCH] drm/arc: Fix refcount leak in arcpgu_load

2022-05-30 Thread Miaoqian Lin
of_graph_get_remote_port_parent() returns a node pointer with refcount incremented, we should use of_node_put() on it when done. Add missing of_node_put() to avoid refcount leak. Fixes: 3ea66a794fdc ("drm/arc: Inline arcpgu_drm_hdmi_init") Signed-off-by: Miaoqian Lin --- drivers/gp

[PATCH] drm/mcde: Fix refcount leak in mcde_dsi_bind

2022-05-25 Thread Miaoqian Lin
MCDE") Signed-off-by: Miaoqian Lin --- drivers/gpu/drm/mcde/mcde_dsi.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/gpu/drm/mcde/mcde_dsi.c b/drivers/gpu/drm/mcde/mcde_dsi.c index 5651734ce977..9f9ac8699310 100644 --- a/drivers/gpu/drm/mcde/mcde_dsi.c +++ b/drivers/gp

[PATCH] drm/msm/a6xx: Fix refcount leak in a6xx_gpu_init

2022-05-12 Thread Miaoqian Lin
the node after usage. Add missing of_node_put() to avoid refcount leak. Fixes: 4b565ca5a2cb ("drm/msm: Add A6XX device support") Signed-off-by: Miaoqian Lin --- drivers/gpu/drm/msm/adreno/a6xx_gpu.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/gpu/drm/msm/adreno/a6xx_gpu.c

[PATCH] video: fbdev: Fix refcount leak in clcdfb_of_vram_setup

2022-05-12 Thread Miaoqian Lin
of_parse_phandle() returns a node pointer with refcount incremented, we should use of_node_put() on it when not need anymore. Add missing of_node_put() to avoid refcount leak. Fixes: d10715be03bd ("video: ARM CLCD: Add DT support") Signed-off-by: Miaoqian Lin --- drivers/video/fbdev/a

Re: [PATCH] drm/meson: Fix refcount leak in meson_encoder_hdmi_init

2022-05-12 Thread Miaoqian Lin
Hi, On 2022/5/12 17:32, Neil Armstrong wrote: > Hi, > > On 12/05/2022 11:21, Miaoqian Lin wrote: >> of_find_device_by_node() takes a reference to the embedded struct device, >> we should use put_device() to release it when not need anymore. >> Add missing put_devi

[PATCH] drm/meson: Fix refcount leak in meson_encoder_hdmi_init

2022-05-12 Thread Miaoqian Lin
ECTOR") Signed-off-by: Miaoqian Lin --- drivers/gpu/drm/meson/meson_encoder_hdmi.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/meson/meson_encoder_hdmi.c b/drivers/gpu/drm/meson/meson_encoder_hdmi.c index 5e306de6f485..de87f02cd388 100644 --- a/drive

[PATCH] drm/meson: Fix refcount leak in meson_encoder_hdmi_init

2022-05-10 Thread Miaoqian Lin
of_find_device_by_node() takes reference, we should use put_device() to release it when not need anymore. Add missing put_device() in error path to avoid refcount leak. Fixes: 0af5e0b41110 ("drm/meson: encoder_hdmi: switch to bridge DRM_BRIDGE_ATTACH_NO_CONNECTOR") Signed-off-by: Mi

[PATCH] drm/amd/display: Fix memory leak in dcn21_clock_source_create

2022-04-21 Thread Miaoqian Lin
When dcn20_clk_src_construct() fails, we need to release clk_src. Fixes: 6f4e6361c3ff ("drm/amd/display: Add Renoir resource (v2)") Signed-off-by: Miaoqian Lin --- drivers/gpu/drm/amd/display/dc/dcn21/dcn21_resource.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/g

[PATCH v3] drm/vc4: Use pm_runtime_resume_and_get to fix pm_runtime_get_sync() usage

2022-04-20 Thread Miaoqian Lin
river") Signed-off-by: Miaoqian Lin --- change in v2: - switch to pm_runtime_resume_and_get() to fix refcount leak. changes in v3: - keep the original checking way for retval. --- drivers/gpu/drm/vc4/vc4_dsi.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/g

Re: [PATCH v2] drm/vc4: Fix pm_runtime_get_sync() usage

2022-04-20 Thread Miaoqian Lin
On 2022/4/20 15:51, Maxime Ripard wrote: > On Wed, Apr 20, 2022 at 12:49:48AM +0000, Miaoqian Lin wrote: >> If the device is already in a runtime PM enabled state >> pm_runtime_get_sync() will return 1, so a test for negative >> value should be used to check for errors

[PATCH v2] drm/bridge: Fix error handling in analogix_dp_probe

2022-04-19 Thread Miaoqian Lin
In the error handling path, the clk_prepare_enable() function call should be balanced by a corresponding 'clk_disable_unprepare()' call , as already done in the remove function. Fixes: 3424e3a4f844 ("drm: bridge: analogix/dp: split exynos dp driver to bridge directory") Signed-off-by

[PATCH v2] drm/vc4: Fix pm_runtime_get_sync() usage

2022-04-19 Thread Miaoqian Lin
will handle this. Fixes: 4078f5757144 ("drm/vc4: Add DSI driver") Signed-off-by: Miaoqian Lin --- change in v2: - switch to pm_runtime_resume_and_get() to fix refcount leak. --- drivers/gpu/drm/vc4/vc4_dsi.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/g

[PATCH] drm/armada: Fix a potential double free in armada_drm_bind

2022-04-16 Thread Miaoqian Lin
priv is a managed resource allocated with devm_drm_dev_alloc(), so there is no need to call kfree() explicitly or there will be a double free. Fixes: 90ad200b4cbc ("drm/armada: Use devm_drm_dev_alloc") Signed-off-by: Miaoqian Lin --- drivers/gpu/drm/armada/armada_drv.c | 1 - 1 file

[PATCH] drm/vc4: Fix pm_runtime_get_sync() error checking

2022-04-12 Thread Miaoqian Lin
If the device is already in a runtime PM enabled state pm_runtime_get_sync() will return 1, so a test for negative value should be used to check for errors. Fixes: 4078f5757144 ("drm/vc4: Add DSI driver") Signed-off-by: Miaoqian Lin --- drivers/gpu/drm/vc4/vc4_dsi.c | 2 +- 1 file

[PATCH] drm/bridge: Fix error handling in analogix_dp_probe

2022-04-02 Thread Miaoqian Lin
In the error handling path, the clk_prepare_enable() function call should be balanced by a corresponding 'clk_disable_unprepare()' call , as already done in the remove function. Fixes: 3424e3a4f844 ("drm: bridge: analogix/dp: split exynos dp driver to bridge directory") Signed-off-by

[PATCH] omapfb: Add missing of_node_put() in dvic_probe_of

2022-03-07 Thread Miaoqian Lin
The device_node pointer is returned by of_parse_phandle() with refcount incremented. We should use of_node_put() on it when done. Fixes: f76ee892a99e ("omapfb: copy omapdss & displays for omapfb") Signed-off-by: Miaoqian Lin --- drivers/video/fbdev/omap2/omapfb/displays/conne

[PATCH v2] drm/i915/selftests: Fix NULL vs IS_ERR checking for kernel_context

2022-01-24 Thread Miaoqian Lin
Since i915_gem_create_context() function return error pointers, the kernel_context() function does not return null, It returns error pointers too. Using IS_ERR() to check the return value to fix this. Signed-off-by: Miaoqian Lin --- Changes in v2: - clean up unneeded initialization of err

[PATCH] drm/amdgpu: Fix double free in amdgpu_get_xgmi_hive

2022-01-20 Thread Miaoqian Lin
Callback function amdgpu_xgmi_hive_release() in kobject_put() calls kfree(hive), So we don't need call kfree(hive) again. Fixes: 7b833d680481 ("drm/amd/amdgpu: fix potential memleak") Signed-off-by: Miaoqian Lin --- drivers/gpu/drm/amd/amdgpu/amdgpu_xgmi.c | 1 - 1 file changed,

[PATCH] drm/tegra: Fix reference leak in tegra_dsi_ganged_probe

2022-01-09 Thread Miaoqian Lin
The reference taken by 'of_find_device_by_node()' must be released when not needed anymore. Add put_device() call to fix this. Fixes: e94236cde4d5 ("drm/tegra: dsi: Add ganged mode support") Signed-off-by: Miaoqian Lin --- drivers/gpu/drm/tegra/dsi.c | 4 +++- 1 file changed, 3 insert

Re: [PATCH v2] drm/v3d: Fix PM disable depth imbalance in v3d_platform_drm_probe

2022-01-09 Thread Miaoqian Lin
Hi Melissa, On Sun, Jan 09, 2022 at 04:48:17PM -0100, Melissa Wen wrote: > On 01/06, Miaoqian Lin wrote: > > The pm_runtime_enable will increase power disable depth. > > If the probe fails, we should use pm_runtime_disable() to balance > > pm_runtime_enable().

[PATCH] drm/msm/hdmi: Fix missing put_device() call in msm_hdmi_get_phy

2022-01-07 Thread Miaoqian Lin
The reference taken by 'of_find_device_by_node()' must be released when not needed anymore. Add the corresponding 'put_device()' in the error handling path. Fixes: e00012b256d4 ("drm/msm/hdmi: Make HDMI core get its PHY") Signed-off-by: Miaoqian Lin --- drivers/gpu/drm/msm/hdmi/

[PATCH] drm/sun4i: dw-hdmi: Fix missing put_device() call in sun8i_hdmi_phy_get

2022-01-07 Thread Miaoqian Lin
The reference taken by 'of_find_device_by_node()' must be released when not needed anymore. Add the corresponding 'put_device()' in the error handling path. Fixes: 9bf3797796f5 ("drm/sun4i: dw-hdmi: Make HDMI PHY into a platform device") Signed-off-by: Miaoqian Lin --- drivers/gpu

[PATCH v2] drm/v3d: Fix PM disable depth imbalance in v3d_platform_drm_probe

2022-01-06 Thread Miaoqian Lin
The pm_runtime_enable will increase power disable depth. If the probe fails, we should use pm_runtime_disable() to balance pm_runtime_enable(). Fixes: 57692c9 ("drm/v3d: Introduce a new DRM driver for Broadcom V3D V3.x+") Signed-off-by: Miaoqian Lin --- Changes in v2 - put pm_runti

Re: [PATCH] phy: mediatek: Fix missing check in mtk_mipi_tx_probe

2022-01-06 Thread Miaoqian Lin
Hi, Chun-Kuang: On Fri, Dec 31, 2021 at 12:31:33AM +0800, Chun-Kuang Hu wrote: > > diff --git a/drivers/phy/mediatek/phy-mtk-mipi-dsi.c > > b/drivers/phy/mediatek/phy-mtk-mipi-dsi.c > > index 28ad9403c441..67b005d5b9e3 100644 > > --- a/drivers/phy/mediatek/phy-mtk-mipi-dsi.c > > +++

[PATCH] drm/v3d: Fix PM disable depth imbalance in v3d_platform_drm_probe

2022-01-05 Thread Miaoqian Lin
The pm_runtime_enable will increase power disable depth. If the probe fails, we should use pm_runtime_disable() to balance pm_runtime_enable(). Fixes: 57692c9 ("drm/v3d: Introduce a new DRM driver for Broadcom V3D V3.x+") Signed-off-by: Miaoqian Lin --- drivers/gpu/drm/v3d/v3d_drv.c

[PATCH] drm/bridge: nwl-dsi: Fix PM disable depth imbalance in nwl_dsi_probe

2022-01-05 Thread Miaoqian Lin
The pm_runtime_enable will increase power disable depth. Thus a pairing decrement is needed on the error handling path to keep it balanced according to context. Fixes: 44cfc62 ("drm/bridge: Add NWL MIPI DSI host controller support") Signed-off-by: Miaoqian Lin --- drivers/gpu/drm/

[PATCH] drm/bridge: Add missing pm_runtime_disable() in __dw_mipi_dsi_probe

2022-01-05 Thread Miaoqian Lin
If the probe fails, we should use pm_runtime_disable() to balance pm_runtime_enable(). Add missing pm_runtime_disable() for __dw_mipi_dsi_probe. Fixes: 46fc515 ("drm/bridge/synopsys: Add MIPI DSI host controller bridge") Signed-off-by: Miaoqian Lin --- drivers/gpu/drm/bridge/synops

[PATCH] drm/msm/dsi: Fix missing put_device() call in dsi_get_phy

2021-12-29 Thread Miaoqian Lin
If of_find_device_by_node() succeeds, dsi_get_phy() doesn't a corresponding put_device(). Thus add put_device() to fix the exception handling. Fixes: ec31abf ("drm/msm/dsi: Separate PHY to another platform device") Signed-off-by: Miaoqian Lin --- drivers/gpu/drm/msm/dsi/dsi.c | 7

[PATCH] drm/mipi-dsi: Fix error handling in mipi_dsi_device_register_full

2021-12-27 Thread Miaoqian Lin
In mipi_dsi_device_alloc(), it calls device_initialize(>dev); We need to use put_device() instead freeing directly. Fixes: 068a002 ("drm: Add MIPI DSI bus support") Signed-off-by: Miaoqian Lin --- drivers/gpu/drm/drm_mipi_dsi.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-

[PATCH] drm/bridge: Fix free wrong object in sii8620_init_rcp_input_dev

2021-12-27 Thread Miaoqian Lin
rc_dev is allocated by rc_allocate_device(), and doesn't assigned to ctx->rc_dev before calling rc_free_device(ctx->rc_dev). So it should call rc_free_device(rc_dev); Fixes: e25f1f7 ("drm/bridge/sii8620: add remote control support") Signed-off-by: Miaoqian Lin --- drivers/gp

[PATCH] phy: mediatek: Fix missing check in mtk_mipi_tx_probe

2021-12-24 Thread Miaoqian Lin
The of_device_get_match_data() function may return NULL. Add check to prevent potential null dereference. Signed-off-by: Miaoqian Lin --- drivers/phy/mediatek/phy-mtk-mipi-dsi.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/phy/mediatek/phy-mtk-mipi-dsi.c b/drivers/phy/mediatek

[PATCH] drm/bridge: anx7625: Fix null vs IS_ERR() checking in anx7625_register_i2c_dummy_clients

2021-12-22 Thread Miaoqian Lin
Signed-off-by: Miaoqian Lin --- drivers/gpu/drm/bridge/analogix/anx7625.c | 32 --- 1 file changed, 23 insertions(+), 9 deletions(-) diff --git a/drivers/gpu/drm/bridge/analogix/anx7625.c b/drivers/gpu/drm/bridge/analogix/anx7625.c index 1a871f6b6822..eb72aa6aedd6 100644 --- a/drive

[PATCH] drm/i915/selftests: Fix NULL vs IS_ERR checking for kernel_context

2021-12-21 Thread Miaoqian Lin
Since i915_gem_create_context() function return error pointers, the kernel_context() function does not return null, It returns error pointers too. Using IS_ERR() to check the return value to fix this. Signed-off-by: Miaoqian Lin --- drivers/gpu/drm/i915/gt/selftest_execlists.c | 41

[PATCH] drm/virtio: Fix NULL vs IS_ERR checking in virtio_gpu_object_shmem_init

2021-12-21 Thread Miaoqian Lin
Since drm_prime_pages_to_sg() function return error pointers. The drm_gem_shmem_get_sg_table() function returns error pointers too. Using IS_ERR() to check the return value to fix this. Fixes: f651c8b05542("drm/virtio: factor out the sg_table from virtio_gpu_object") Signed-off-by: Mi

[PATCH] drm/amdkfd: Fix missing check in kfd_parse_subtype_iolink

2021-12-14 Thread Miaoqian Lin
The kmemdup() function may return NULL in case of error. Add NULL checking to prevent potential null deference. Signed-off-by: Miaoqian Lin --- drivers/gpu/drm/amd/amdkfd/kfd_crat.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/gpu/drm/amd/amdkfd/kfd_crat.c b/drivers/gpu/drm

[PATCH] udmabuf: Fix NULL vs IS_ERR() checking

2021-12-12 Thread Miaoqian Lin
The get_sg_table() function does not return NULL. It returns error pointers. Signed-off-by: Miaoqian Lin --- drivers/gpu/drm/arm/malidp_planes.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/drm/arm/malidp_planes.c b/drivers/gpu/drm/arm/malidp_planes.c index

[PATCH] lib/genalloc: Fix NULL vs IS_ERR() checking

2021-12-12 Thread Miaoqian Lin
The devm_gen_pool_create() function does not return NULL. It returns error pointers. Signed-off-by: Miaoqian Lin --- drivers/gpu/drm/vboxvideo/vbox_main.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/vboxvideo/vbox_main.c b/drivers/gpu/drm/vboxvideo

[PATCH] drm/i915/selftests: Fix inconsistent object in IS_ERR and PTR_ERR

2021-12-10 Thread Miaoqian Lin
Fix inconsistent object in IS_ERR and PTR_ERR in igt_dmabuf_import_same_driver and igt_dmabuf_import_same_driver_lmem. As obj is the return value of __i915_gem_object_create_user, the proper object to be passed as argument to PTR_ERR is obj. Signed-off-by: Miaoqian Lin --- drivers/gpu/drm/i915