Commit 6b568689 authored by Kalesh AP's avatar Kalesh AP Committed by David S. Miller

be2net: return -ENOMEM for memory allocation failures

Signed-off-by: default avatarSathya Perla <sathya.perla@emulex.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent fd45160c
...@@ -2931,7 +2931,7 @@ static int be_setup_wol(struct be_adapter *adapter, bool enable) ...@@ -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, cmd.va = dma_zalloc_coherent(&adapter->pdev->dev, cmd.size, &cmd.dma,
GFP_KERNEL); GFP_KERNEL);
if (cmd.va == NULL) if (cmd.va == NULL)
return -1; return -ENOMEM;
if (enable) { if (enable) {
status = pci_write_config_dword(adapter->pdev, status = pci_write_config_dword(adapter->pdev,
...@@ -4586,7 +4586,7 @@ static int be_stats_init(struct be_adapter *adapter) ...@@ -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, cmd->va = dma_zalloc_coherent(&adapter->pdev->dev, cmd->size, &cmd->dma,
GFP_KERNEL); GFP_KERNEL);
if (cmd->va == NULL) if (cmd->va == NULL)
return -1; return -ENOMEM;
return 0; return 0;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment