[PATCH 1/7] net: e1000: remove superfluous allocation check

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



dma_alloc() calls xmemalign which panics if unable to allocate memory,
so there is no need to check the returned pointer for validity.

Signed-off-by: Denis Orlov <denorl2009@xxxxxxxxx>
---
 drivers/net/e1000/main.c | 3 ---
 1 file changed, 3 deletions(-)

diff --git a/drivers/net/e1000/main.c b/drivers/net/e1000/main.c
index f67c5d867b..bfb8d8ff2f 100644
--- a/drivers/net/e1000/main.c
+++ b/drivers/net/e1000/main.c
@@ -3575,9 +3575,6 @@ static int e1000_probe(struct pci_dev *pdev, const struct pci_device_id *id)
 	edev->priv = hw;
 
 	hw->packet = dma_alloc(PAGE_SIZE);
-	if (!hw->packet)
-		return -ENOMEM;
-
 	hw->packet_dma = dma_map_single(hw->dev, hw->packet, PAGE_SIZE,
 					DMA_FROM_DEVICE);
 	if (dma_mapping_error(hw->dev, hw->packet_dma))
-- 
2.20.1





[Index of Archives]     [Linux Embedded]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux