be2net: return -ENOMEM for memory allocation failures
authorKalesh AP <kalesh.purayil@emulex.com>
Thu, 17 Jul 2014 10:50:22 +0000 (16:20 +0530)
committerDavid S. Miller <davem@davemloft.net>
Thu, 17 Jul 2014 23:38:14 +0000 (16:38 -0700)
Signed-off-by: Sathya Perla <sathya.perla@emulex.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/emulex/benet/be_main.c

index 1f3daee5edc381b060e581d1b45458996e2a7425..8826b778b3ab7f3b0b0badf49c5356cc704b6bf7 100644 (file)
@@ -2931,7 +2931,7 @@ static int be_setup_wol(struct be_adapter *adapter, bool enable)
        cmd.va = dma_zalloc_coherent(&adapter->pdev->dev, cmd.size, &cmd.dma,
                                     GFP_KERNEL);
        if (cmd.va == NULL)
-               return -1;
+               return -ENOMEM;
 
        if (enable) {
                status = pci_write_config_dword(adapter->pdev,
@@ -4586,7 +4586,7 @@ static int be_stats_init(struct be_adapter *adapter)
        cmd->va = dma_zalloc_coherent(&adapter->pdev->dev, cmd->size, &cmd->dma,
                                      GFP_KERNEL);
        if (cmd->va == NULL)
-               return -1;
+               return -ENOMEM;
        return 0;
 }