Skip to contentSkip to conversation

netrom: Delete an error message for a failed memory allocation in nr_proto_init()

PATCH New SF Markus Elfring 1 participant 1 message Oct 14, 2017

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

PATCH 1/1 netrom: Delete an error message for a failed memory allocation in nr_proto_init()

From: Markus Elfring <[email protected]>
Date: Sat, 14 Oct 2017 18:48:18 +0200

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

This issue was detected by using the Coccinelle software.

---
 net/netrom/af_netrom.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)
net/netrom/af_netrom.c +1 -3
index ebf16f7f9089..568d6a148bf2 100644
@@ -1408,10 +1408,8 @@ static int __init nr_proto_init(void)
 	}
 
 	dev_nr = kzalloc(nr_ndevs * sizeof(struct net_device *), GFP_KERNEL);
-	if (dev_nr = NULL) {
-		printk(KERN_ERR "NET/ROM: nr_proto_init - unable to allocate device array\n");
+	if (!dev_nr)
 		return -1;
-	}
 
 	for (i = 0; i < nr_ndevs; i++) {
 		char name[IFNAMSIZ];
Signature · 1 line
2.14.2