* [PATCH] tty: cyclades: Delete an error message for a failed memory allocation in cy_init_card()
@ 2017-12-10 16:25 SF Markus Elfring
0 siblings, 0 replies; only message in thread
From: SF Markus Elfring @ 2017-12-10 16:25 UTC (permalink / raw)
To: kernel-janitors, Greg Kroah-Hartman, Jiri Slaby; +Cc: LKML
From: Markus Elfring <elfring@users.sourceforge.net>
Date: Sun, 10 Dec 2017 17:21:28 +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@users.sourceforge.net>
---
drivers/tty/cyclades.c | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)
diff --git a/drivers/tty/cyclades.c b/drivers/tty/cyclades.c
index 5d442469c95e..a0dbce2cf2d9 100644
--- a/drivers/tty/cyclades.c
+++ b/drivers/tty/cyclades.c
@@ -3061,10 +3061,8 @@ static int cy_init_card(struct cyclades_card *cinfo)
cinfo->ports = kcalloc(cinfo->nports, sizeof(*cinfo->ports),
GFP_KERNEL);
- if (cinfo->ports == NULL) {
- printk(KERN_ERR "Cyclades: cannot allocate ports\n");
+ if (!cinfo->ports)
return -ENOMEM;
- }
for (channel = 0, port = cinfo->first_line; channel < cinfo->nports;
channel++, port++) {
--
2.15.1
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2017-12-10 16:26 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-12-10 16:25 [PATCH] tty: cyclades: Delete an error message for a failed memory allocation in cy_init_card() SF Markus Elfring
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).