From 6b5686891c9858aea914c1d1c965d6bbc8a0521d Mon Sep 17 00:00:00 2001 From: Kalesh AP Date: Thu, 17 Jul 2014 16:20:22 +0530 Subject: [PATCH] be2net: return -ENOMEM for memory allocation failures Signed-off-by: Sathya Perla Signed-off-by: David S. Miller --- drivers/net/ethernet/emulex/benet/be_main.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/net/ethernet/emulex/benet/be_main.c b/drivers/net/ethernet/emulex/benet/be_main.c index 1f3daee5edc3..8826b778b3ab 100644 --- a/drivers/net/ethernet/emulex/benet/be_main.c +++ b/drivers/net/ethernet/emulex/benet/be_main.c @@ -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; } -- GitLab