kvm.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] uio/uio_pci_generic: fix return value changed in refactoring
@ 2021-04-22 19:22 Martin Ågren
  2021-04-23 20:28 ` Michael S. Tsirkin
  0 siblings, 1 reply; 2+ messages in thread
From: Martin Ågren @ 2021-04-22 19:22 UTC (permalink / raw)
  To: kvm, linux-kernel
  Cc: Michael S. Tsirkin, Greg Kroah-Hartman, Alexandru Ardelean

Commit ef84928cff58 ("uio/uio_pci_generic: use device-managed function
equivalents") was able to simplify various error paths thanks to no
longer having to clean up on the way out. Some error paths were dropped,
others were simplified. In one of those simplifications, the return
value was accidentally changed from -ENODEV to -ENOMEM. Restore the old
return value.

Fixes: ef84928cff58 ("uio/uio_pci_generic: use device-managed function equivalents")
Signed-off-by: Martin Ågren <martin.agren@gmail.com>
---
 This is my first contribution to the Linux kernel. Hints, suggestions,
 corrections and any other feedback welcome.

 drivers/uio/uio_pci_generic.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/uio/uio_pci_generic.c b/drivers/uio/uio_pci_generic.c
index c7d681fef198..3bb0b0075467 100644
--- a/drivers/uio/uio_pci_generic.c
+++ b/drivers/uio/uio_pci_generic.c
@@ -81,9 +81,9 @@ static int probe(struct pci_dev *pdev,
 		return err;
 	}
 
 	if (pdev->irq && !pci_intx_mask_supported(pdev))
-		return -ENOMEM;
+		return -ENODEV;
 
 	gdev = devm_kzalloc(&pdev->dev, sizeof(struct uio_pci_generic_dev), GFP_KERNEL);
 	if (!gdev)
 		return -ENOMEM;
-- 
2.31.1.527.g47e6f16901


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

* Re: [PATCH] uio/uio_pci_generic: fix return value changed in refactoring
  2021-04-22 19:22 [PATCH] uio/uio_pci_generic: fix return value changed in refactoring Martin Ågren
@ 2021-04-23 20:28 ` Michael S. Tsirkin
  0 siblings, 0 replies; 2+ messages in thread
From: Michael S. Tsirkin @ 2021-04-23 20:28 UTC (permalink / raw)
  To: Martin Ågren
  Cc: kvm, linux-kernel, Greg Kroah-Hartman, Alexandru Ardelean

On Thu, Apr 22, 2021 at 09:22:40PM +0200, Martin Ågren wrote:
> Commit ef84928cff58 ("uio/uio_pci_generic: use device-managed function
> equivalents") was able to simplify various error paths thanks to no
> longer having to clean up on the way out. Some error paths were dropped,
> others were simplified. In one of those simplifications, the return
> value was accidentally changed from -ENODEV to -ENOMEM. Restore the old
> return value.
> 
> Fixes: ef84928cff58 ("uio/uio_pci_generic: use device-managed function equivalents")
> Signed-off-by: Martin Ågren <martin.agren@gmail.com>

Acked-by: Michael S. Tsirkin <mst@redhat.com>

> ---
>  This is my first contribution to the Linux kernel. Hints, suggestions,
>  corrections and any other feedback welcome.
> 
>  drivers/uio/uio_pci_generic.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/uio/uio_pci_generic.c b/drivers/uio/uio_pci_generic.c
> index c7d681fef198..3bb0b0075467 100644
> --- a/drivers/uio/uio_pci_generic.c
> +++ b/drivers/uio/uio_pci_generic.c
> @@ -81,9 +81,9 @@ static int probe(struct pci_dev *pdev,
>  		return err;
>  	}
>  
>  	if (pdev->irq && !pci_intx_mask_supported(pdev))
> -		return -ENOMEM;
> +		return -ENODEV;
>  
>  	gdev = devm_kzalloc(&pdev->dev, sizeof(struct uio_pci_generic_dev), GFP_KERNEL);
>  	if (!gdev)
>  		return -ENOMEM;
> -- 
> 2.31.1.527.g47e6f16901


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

end of thread, other threads:[~2021-04-23 20:28 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-04-22 19:22 [PATCH] uio/uio_pci_generic: fix return value changed in refactoring Martin Ågren
2021-04-23 20:28 ` Michael S. Tsirkin

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).