[PATCH 1/3] char/pcmcia: Delete an error message for a failed memory allocation in mgslpc_probe()

From: SF Markus Elfring
Date: Mon Oct 16 2017 - 08:19:10 EST


From: Markus Elfring <elfring@xxxxxxxxxxxxxxxxxxxxx>
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 <elfring@xxxxxxxxxxxxxxxxxxxxx>
---
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