mirror of https://gitee.com/openkylin/linux.git
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:
parent
fd45160cef
commit
6b5686891c
|
@ -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)
|
||||||
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;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue