[PATCH] drm/amd: Use pci_dev_id() to simplify the code

2023-08-07 Thread Xiongfeng Wang
PCI core API pci_dev_id() can be used to get the BDF number for a pci device. We don't need to compose it mannually. Use pci_dev_id() to simplify the code a little bit. Signed-off-by: Xiongfeng Wang --- drivers/gpu/drm/amd/amdgpu/amdgpu_acpi.c | 8 1 file changed, 4 insertions(

[PATCH 2/2] drm/amdgpu: Fix PCI device refcount leak in amdgpu_atrm_get_bios()

2022-11-22 Thread Xiongfeng Wang
t. Add the missing pci_dev_put() to avoid refcount leak. Fixes: d38ceaf99ed0 ("drm/amdgpu: add core driver (v4)") Signed-off-by: Xiongfeng Wang --- drivers/gpu/drm/amd/amdgpu/amdgpu_bios.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_bios.c b

[PATCH 0/2] drm: Fix PCI device refcount leak

2022-11-22 Thread Xiongfeng Wang
loop, the refcount of the found PCI device is increased. When finish using the PCI device, we need to call pci_dev_put() to decrease the refcount. Xiongfeng Wang (2): drm/radeon: Fix PCI device refcount leak in radeon_atrm_get_bios() drm/amdgpu: Fix PCI device refcount leak in

[PATCH 1/2] drm/radeon: Fix PCI device refcount leak in radeon_atrm_get_bios()

2022-11-22 Thread Xiongfeng Wang
t. Add the missing pci_dev_put() to avoid refcount leak. Fixes: d8ade3526b2a ("drm/radeon: handle non-VGA class pci devices with ATRM") Fixes: c61e2775873f ("drm/radeon: split ATRM support out from the ATPX handler (v3)") Signed-off-by: Xiongfeng Wang --- drivers/gpu/drm/rade

[PATCH] video: fbdev: vermilion: decrease reference count in error path

2022-11-14 Thread Xiongfeng Wang
pci_get_device() will increase the reference count for the returned pci_dev. For the error path, we need to use pci_dev_put() to decrease the reference count. Fixes: dbe7e429fedb ("vmlfb: framebuffer driver for Intel Vermilion Range") Signed-off-by: Xiongfeng Wang --- drivers/v

Re: [PATCH v2] drm/sun4i: dw-hdmi: fix error return code in sun8i_dw_hdmi_bind()

2020-11-18 Thread Xiongfeng Wang
On 2020/11/18 1:47, Jernej Škrabec wrote: > Dne ponedeljek, 16. november 2020 ob 02:09:29 CET je Xiongfeng Wang > napisal(a): >> Fix to return a negative error code from the error handling case instead >> of 0 in function sun8i_dw_hdmi_bind(). >> >> Fixes: b7c74

Re: [PATCH] drm/sun4i: dw-hdmi: fix error return code in sun8i_dw_hdmi_bind()

2020-11-16 Thread Xiongfeng Wang
Hi! On 2020/11/14 2:01, Jernej Škrabec wrote: > Hi! > > Thanks for the patch. > > Dne četrtek, 12. november 2020 ob 14:14:51 CET je Xiongfeng Wang napisal(a): >> Fix to return a negative error code from the error handling case instead >> of 0 in function sun8i_

[PATCH v2] drm/sun4i: dw-hdmi: fix error return code in sun8i_dw_hdmi_bind()

2020-11-16 Thread Xiongfeng Wang
Fix to return a negative error code from the error handling case instead of 0 in function sun8i_dw_hdmi_bind(). Fixes: b7c7436a5ff0 ("drm/sun4i: Implement A83T HDMI driver") Reported-by: Hulk Robot Signed-off-by: Xiongfeng Wang Reviewed-by: Jernej Skrabec --- drivers/gpu

[PATCH] drm/sun4i: dw-hdmi: fix error return code in sun8i_dw_hdmi_bind()

2020-11-13 Thread Xiongfeng Wang
Fix to return a negative error code from the error handling case instead of 0 in function sun8i_dw_hdmi_bind(). Fixes: b7c7436a5ff0 ("drm/sun4i: Implement A83T HDMI driver") Reported-by: Hulk Robot Signed-off-by: Xiongfeng Wang --- drivers/gpu/drm/sun4i/sun8i_dw_hdmi.c | 1 + 1 file

[PATCH] drm/i915/gvt: return error when failing to take the module reference

2020-11-13 Thread Xiongfeng Wang
as self load module") Reported-by: Hulk Robot Signed-off-by: Xiongfeng Wang --- drivers/gpu/drm/i915/gvt/kvmgt.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/i915/gvt/kvmgt.c b/drivers/gpu/drm/i915/gvt/kvmgt.c index ad8a9df..778eb8c 100644 --- a/driv

[PATCH] drm/nouveau/core/client: use strlcpy() instead of strncpy()

2018-01-14 Thread Xiongfeng Wang
From: Xiongfeng Wang gcc-8 reports drivers/gpu/drm/nouveau/nvif/client.c: In function 'nvif_client_init': ./include/linux/string.h:245:9: warning: '__builtin_strncpy' specified bound 32 equals destination size [-Wstringop-truncation] We need to use strlcpy() to make sure th