Skip to contentSkip to conversation

tty: cyclades: Delete an error message for a failed memory allocation in cy_init_card()

PATCH New SF Markus Elfring 1 participant 1 message Dec 10, 2017

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

PATCH 1/1 tty: cyclades: Delete an error message for a failed memory allocation in cy_init_card()

From: Markus Elfring <[email protected]>
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.

---
 drivers/tty/cyclades.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)
drivers/tty/cyclades.c +1 -3
index 5d442469c95e..a0dbce2cf2d9 100644
@@ -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++) {
Signature · 1 line
2.15.1