Skip to contentSkip to conversation

s390: kernel: Delete an error message for a failed memory allocation in cpcmd()

PATCH In review SF Markus Elfring 2 participants 2 messages May 25, 2017

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

PATCH 1/1 s390: kernel: Delete an error message for a failed memory allocation in cpcmd()

From: Markus Elfring <[email protected]>
Date: Thu, 25 May 2017 19:09:50 +0200

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

This issue was detected by using the Coccinelle software.

---
 arch/s390/kernel/cpcmd.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)
arch/s390/kernel/cpcmd.c +2 -3
index 9f0e4a2785f7..2f9c97813846 100644
@@ -95,10 +95,9 @@ int cpcmd(const char *cmd, char *response, int rlen, int *response_code)
 	if ((virt_to_phys(response) != (unsigned long) response) ||
 			(((unsigned long)response + rlen) >> 31)) {
 		lowbuf = kmalloc(rlen, GFP_KERNEL | GFP_DMA);
-		if (!lowbuf) {
-			pr_warn("The cpcmd kernel function failed to allocate a response buffer\n");
+		if (!lowbuf)
 			return -ENOMEM;
-		}
+
 		spin_lock_irqsave(&cpcmd_lock, flags);
 		len = __cpcmd(cmd, lowbuf, rlen, response_code);
 		spin_unlock_irqrestore(&cpcmd_lock, flags);
Signature · 1 line
2.13.0
#1 lore raw
Quoted 5 lines · [[PATCH] s390: kernel: Delete an error message for a failed memory allocation…

From: Markus Elfring <[email protected]>
Date: Thu, 25 May 2017 19:09:50 +0200

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

Since I was Cc'd -- NACK.

Please, please stop sending garbage patches to every maintainer and project you can find.

P.
--

Quoted 28 lines

This issue was detected by using the Coccinelle software.

---
 arch/s390/kernel/cpcmd.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)
arch/s390/kernel/cpcmd.c +2 -3
index 9f0e4a2785f7..2f9c97813846 100644
@@ -95,10 +95,9 @@ int cpcmd(const char *cmd, char *response, int rlen, int *response_code)
 	if ((virt_to_phys(response) != (unsigned long) response) ||
 			(((unsigned long)response + rlen) >> 31)) {
 		lowbuf = kmalloc(rlen, GFP_KERNEL | GFP_DMA);
-		if (!lowbuf) {
-			pr_warn("The cpcmd kernel function failed to allocate a response buffer\n");
+		if (!lowbuf)
 			return -ENOMEM;
-		}
+
 		spin_lock_irqsave(&cpcmd_lock, flags);
 		len = __cpcmd(cmd, lowbuf, rlen, response_code);
 		spin_unlock_irqrestore(&cpcmd_lock, flags);
Signature · 1 line
2.13.0