[PATCH 1/7] net: e1000: remove superfluous allocation check
Denis Orlov
denorl2009 at gmail.com
Wed Jul 20 06:30:54 PDT 2022
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 at gmail.com>
---
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
More information about the barebox
mailing list