Skip to contentSkip to conversation

net: hns: Delete an error message for a failed memory allocation in hns_rcb_common_get_cfg()

PATCH New SF Markus Elfring 1 participant 1 message Jan 1, 2018

Subsystems (4)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 net: hns: Delete an error message for a failed memory allocation in hns_rcb_common_get_cfg()

From: Markus Elfring <[email protected]>
Date: Mon, 1 Jan 2018 19:11:46 +0100

Omit an extra message for a memory allocation failure in this function.

This issue was detected by using the Coccinelle software.

---
 drivers/net/ethernet/hisilicon/hns/hns_dsaf_rcb.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)
drivers/net/ethernet/hisilicon/hns/hns_dsaf_rcb.c +2 -3
index 6f3570cfb501..cd74f0598dde 100644
@@ -767,10 +767,9 @@ int hns_rcb_common_get_cfg(struct dsaf_device *dsaf_dev,
 	rcb_common  		devm_kzalloc(dsaf_dev->dev, sizeof(*rcb_common) +
 			ring_num * sizeof(struct ring_pair_cb), GFP_KERNEL);
-	if (!rcb_common) {
-		dev_err(dsaf_dev->dev, "rcb common devm_kzalloc fail!\n");
+	if (!rcb_common)
 		return -ENOMEM;
-	}
+
 	rcb_common->comm_index = comm_index;
 	rcb_common->ring_num = ring_num;
 	rcb_common->dsaf_dev = dsaf_dev;
Signature · 1 line
2.15.1