From: Markus Elfring <[email protected]>
Date: Mon, 16 Oct 2017 11:46:38 +0200

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 <[email protected]>
---
 drivers/char/pcmcia/synclink_cs.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/drivers/char/pcmcia/synclink_cs.c 
b/drivers/char/pcmcia/synclink_cs.c
index 62be953e5fb0..4db7eda2e7f2 100644
--- a/drivers/char/pcmcia/synclink_cs.c
+++ b/drivers/char/pcmcia/synclink_cs.c
@@ -520,10 +520,8 @@ static int mgslpc_probe(struct pcmcia_device *link)
                printk("mgslpc_attach\n");
 
        info = kzalloc(sizeof(MGSLPC_INFO), GFP_KERNEL);
-       if (!info) {
-               printk("Error can't allocate device instance data\n");
+       if (!info)
                return -ENOMEM;
-       }
 
        info->magic = MGSLPC_MAGIC;
        tty_port_init(&info->port);
-- 
2.14.2

Reply via email to