Skip to contentSkip to conversation

serial: sc16is7xx: Delete an error message for a failed memory allocation in sc16is7xx_probe()

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

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

PATCH 1/1 serial: sc16is7xx: Delete an error message for a failed memory allocation in sc16is7xx_probe()

From: Markus Elfring <[email protected]>
Date: Fri, 8 Dec 2017 17:27:50 +0100

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

This issue was detected by using the Coccinelle software.

---
 drivers/tty/serial/sc16is7xx.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)
drivers/tty/serial/sc16is7xx.c +1 -3
index 65792a3539d0..8b3c35f77e7c 100644
@@ -1156,10 +1156,8 @@ static int sc16is7xx_probe(struct device *dev,
 	s = devm_kzalloc(dev, sizeof(*s) +
 			 sizeof(struct sc16is7xx_one) * devtype->nr_uart,
 			 GFP_KERNEL);
-	if (!s) {
-		dev_err(dev, "Error allocating port structure\n");
+	if (!s)
 		return -ENOMEM;
-	}
 
 	s->clk = devm_clk_get(dev, NULL);
 	if (IS_ERR(s->clk)) {
Signature · 1 line
2.15.1