lkml.org 
[lkml]   [2021]   [Jul]   [14]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH -next] drm/bochs: Fix missing pci_disable_device() on error in bochs_pci_probe()
From
Date
Hi

Am 14.07.21 um 10:39 schrieb Yang Yingliang:
> Fix the missing pci_disable_device() before return
> from bochs_pci_probe() in the error handling case.

It's maybe better to replace pci_enable_device() with
pcim_enable_device(), [1] so that the release happens automatically.
Does this work?

Best regards
Thomas

https://elixir.bootlin.com/linux/v5.13.1/source/drivers/pci/pci.c#L2042

>
> Reported-by: Hulk Robot <hulkci@huawei.com>
> Signed-off-by: Yang Yingliang <yangyingliang@huawei.com>
> ---
> 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/bochs.c
> index a2cfecfa8556..74832b9d3eae 100644
> --- a/drivers/gpu/drm/tiny/bochs.c
> +++ b/drivers/gpu/drm/tiny/bochs.c
> @@ -666,6 +666,7 @@ static int bochs_pci_probe(struct pci_dev *pdev, const struct pci_device_id *ent
> return ret;
>
> err_free_dev:
> + pci_disable_device(pdev);
> drm_dev_put(dev);
> return ret;
> }
>

--
Thomas Zimmermann
Graphics Driver Developer
SUSE Software Solutions Germany GmbH
Maxfeldstr. 5, 90409 Nürnberg, Germany
(HRB 36809, AG Nürnberg)
Geschäftsführer: Felix Imendörffer

[unhandled content-type:application/pgp-signature]
\
 
 \ /
  Last update: 2021-07-14 11:22    [W:0.069 / U:0.020 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site