提交 6b568689 编写于 作者: K Kalesh AP 提交者: David S. Miller

be2net: return -ENOMEM for memory allocation failures

Signed-off-by: NSathya Perla <sathya.perla@emulex.com>
Signed-off-by: NDavid S. Miller <davem@davemloft.net>
上级 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% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册