linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH -next] drm/bochs: Fix missing pci_disable_device() on error in bochs_pci_probe()
@ 2021-07-14  8:39 Yang Yingliang
  2021-07-14  9:21 ` Thomas Zimmermann
  0 siblings, 1 reply; 2+ messages in thread
From: Yang Yingliang @ 2021-07-14  8:39 UTC (permalink / raw)
  To: linux-kernel, dri-devel, virtualization; +Cc: kraxel, airlied, daniel

Fix the missing pci_disable_device() before return
from bochs_pci_probe() in the error handling case.

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;
 }
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH -next] drm/bochs: Fix missing pci_disable_device() on error in bochs_pci_probe()
  2021-07-14  8:39 [PATCH -next] drm/bochs: Fix missing pci_disable_device() on error in bochs_pci_probe() Yang Yingliang
@ 2021-07-14  9:21 ` Thomas Zimmermann
  0 siblings, 0 replies; 2+ messages in thread
From: Thomas Zimmermann @ 2021-07-14  9:21 UTC (permalink / raw)
  To: Yang Yingliang, linux-kernel, dri-devel, virtualization; +Cc: airlied, kraxel


[-- Attachment #1.1: Type: text/plain, Size: 1231 bytes --]

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


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 840 bytes --]

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2021-07-14  9:21 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-07-14  8:39 [PATCH -next] drm/bochs: Fix missing pci_disable_device() on error in bochs_pci_probe() Yang Yingliang
2021-07-14  9:21 ` Thomas Zimmermann

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).