Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1646639

[PATCH 2/3] net: pktgen: Delete an error message for a failed memory allocation in pktgen_create_thread()

From SF Markus Elfring <elfring@users.sourceforge.net>
Newsgroups linux.kernel
Subject [PATCH 2/3] net: pktgen: Delete an error message for a failed memory allocation in pktgen_create_thread()
Date 2017-05-22 11:20 +0200
Message-ID <tJRFo-3IZ-19@gated-at.bofh.it> (permalink)
References <tJRFn-3IZ-3@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


From: Markus Elfring <elfring@users.sourceforge.net>
Date: Mon, 22 May 2017 10:38:46 +0200

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

This issue was detected by using the Coccinelle software.

Link: http://events.linuxfoundation.org/sites/events/files/slides/LCJ16-Refactor_Strings-WSang_0.pdf
Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
---
 net/core/pktgen.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/net/core/pktgen.c b/net/core/pktgen.c
index c89f4ad21187..51008ddc7af6 100644
--- a/net/core/pktgen.c
+++ b/net/core/pktgen.c
@@ -3760,7 +3760,5 @@ static int __net_init pktgen_create_thread(int cpu, struct pktgen_net *pn)
-	if (!t) {
-		pr_err("ERROR: out of memory, can't create new thread\n");
+	if (!t)
 		return -ENOMEM;
-	}
 
 	mutex_init(&t->if_lock);
 	t->cpu = cpu;
-- 
2.13.0

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH 0/3] net-pktgen: Adjustments for some function implementations SF Markus Elfring <elfring@users.sourceforge.net> - 2017-05-22 11:20 +0200
  [PATCH 2/3] net: pktgen: Delete an error message for a failed memory  allocation in pktgen_create_thread() SF Markus Elfring <elfring@users.sourceforge.net> - 2017-05-22 11:20 +0200
  [PATCH 3/3] net: pktgen: Adjust five checks for null pointers SF Markus Elfring <elfring@users.sourceforge.net> - 2017-05-22 11:20 +0200

csiph-web