Skip to contentSkip to conversation

uio/uio_pci_generic: fix return value changed in refactoring

PATCH In review Martin Ågren 2 participants 2 messages Apr 22, 2021 – Apr 23, 2021

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 uio/uio_pci_generic: fix return value changed in refactoring

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

---
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(-)
drivers/uio/uio_pci_generic.c +1 -1
index c7d681fef198..3bb0b0075467 100644
@@ -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;
Signature · 1 line
2.31.1.527.g47e6f16901
maintainer Acked-by on v1 1/1
#1 lore raw
Quoted 9 lines · Martin Ågren

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")
Quoted 24 lines

---
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(-)
drivers/uio/uio_pci_generic.c +1 -1
index c7d681fef198..3bb0b0075467 100644
@@ -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;
Signature · 1 line
2.31.1.527.g47e6f16901