be2net: return -ENOMEM for memory allocation failures

Signed-off-by: Sathya Perla <sathya.perla@emulex.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
Kalesh AP 2014-07-17 16:20:22 +05:30 committed by David S. Miller
parent fd45160cef
commit 6b5686891c
1 changed files with 2 additions and 2 deletions

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