On Wed, 2026-05-20 at 09:47 +0800, [email protected] wrote:
> From: Lu Yao <[email protected]>
> 
> Need to call pci_dev_put() after pci_get_domain_bus_and_slot().
> 
> Fixes: f39db26c5428 ("drm: Add kms driver for loongson display controller")
> Signed-off-by: Lu Yao <[email protected]>
> ---
> v1->v2: add fixes tag and parentheses to function names suggested by
> Markus.
>   Link: 
> https://lore.kernel.org/dri-devel/[email protected]/#R
> 
>  drivers/gpu/drm/loongson/lsdc_drv.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> 
> diff --git a/drivers/gpu/drm/loongson/lsdc_drv.c 
> b/drivers/gpu/drm/loongson/lsdc_drv.c
> index 34405073c4d4..6cd21480c979 100644
> --- a/drivers/gpu/drm/loongson/lsdc_drv.c
> +++ b/drivers/gpu/drm/loongson/lsdc_drv.c
> @@ -183,6 +183,7 @@ static int lsdc_get_dedicated_vram(struct lsdc_device 
> *ldev,
>       ldev->vram_size = size;
>       ldev->gpu = pdev_gpu;
>  
> +     pci_dev_put(pdev_gpu);

It looks suspicious as pci_dev_put will immediately invalidate pdev_gpu
that we just assigned to ldev->gpu.

>From what I can tell it seems nobody is using that value though.  IMO we
should remove the assignment and also drop the gpu field in struct
lsdc_device.


-- 
Xi Ruoyao <[email protected]>

Reply via email to