]> git.proxmox.com Git - mirror_ubuntu-focal-kernel.git/commitdiff
staging: mt7621-pci: replace return value if devm_pci_alloc_host_bridge call fails
authorSergio Paracuellos <sergio.paracuellos@gmail.com>
Sun, 4 Nov 2018 10:49:28 +0000 (11:49 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sun, 11 Nov 2018 19:36:14 +0000 (11:36 -0800)
Driver probe function calls 'devm_pci_alloc_host_bridge'. If this call fails
it is returning -ENODEV. Return -ENOMEM instead which is more accurate for
this.

Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/mt7621-pci/pci-mt7621.c

index b7cb2733a9ea56f5e0755a11e575c810e0099b0c..357bbddb02addf99f524e21765e044893182ec6a 100644 (file)
@@ -516,7 +516,7 @@ static int mt7621_pci_probe(struct platform_device *pdev)
 
        bridge = devm_pci_alloc_host_bridge(dev, sizeof(*pcie));
        if (!bridge)
-               return -ENODEV;
+               return -ENOMEM;
 
        pcie = pci_host_bridge_priv(bridge);
        pcie->dev = dev;