[PATCH] firmware-gsmi: Delete an error message for a failed memory allocation in gsmi_buf_alloc()

From: SF Markus Elfring
Date: Sun Feb 11 2018 - 16:26:37 EST


From: Markus Elfring <elfring@xxxxxxxxxxxxxxxxxxxxx>
Date: Sun, 11 Feb 2018 22:22:02 +0100

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

This issue was detected by using the Coccinelle software.

Signed-off-by: Markus Elfring <elfring@xxxxxxxxxxxxxxxxxxxxx>
---
drivers/firmware/google/gsmi.c | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/drivers/firmware/google/gsmi.c b/drivers/firmware/google/gsmi.c
index c8f169bf2e27..fbf661e0b784 100644
--- a/drivers/firmware/google/gsmi.c
+++ b/drivers/firmware/google/gsmi.c
@@ -138,10 +138,8 @@ static struct gsmi_buf *gsmi_buf_alloc(void)
struct gsmi_buf *smibuf;

smibuf = kzalloc(sizeof(*smibuf), GFP_KERNEL);
- if (!smibuf) {
- printk(KERN_ERR "gsmi: out of memory\n");
+ if (!smibuf)
return NULL;
- }

/* allocate buffer in 32bit address space */
smibuf->start = dma_pool_alloc(gsmi_dev.dma_pool, GFP_KERNEL,
--
2.16.1