public inbox for kernel-janitors@vger.kernel.org
 help / color / mirror / Atom feed
* [patch] gpio: ge: fix error code in gef_gpio_probe()
@ 2015-01-28 19:13 Dan Carpenter
  2015-02-09  5:29 ` Alexandre Courbot
  0 siblings, 1 reply; 2+ messages in thread
From: Dan Carpenter @ 2015-01-28 19:13 UTC (permalink / raw)
  To: Linus Walleij, Kamlakant Patel
  Cc: Alexandre Courbot, linux-gpio, kernel-janitors

If kstrdup() fails then we should return -ENOMEM but instead the current
code returns success.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>

diff --git a/drivers/gpio/gpio-ge.c b/drivers/gpio/gpio-ge.c
index 6ea9303..07e9b39 100644
--- a/drivers/gpio/gpio-ge.c
+++ b/drivers/gpio/gpio-ge.c
@@ -77,8 +77,10 @@ static int __init gef_gpio_probe(struct platform_device *pdev)
 
 	/* Setup pointers to chip functions */
 	bgc->gc.label = kstrdup(pdev->dev.of_node->full_name, GFP_KERNEL);
-	if (!bgc->gc.label)
+	if (!bgc->gc.label) {
+		ret = -ENOMEM;
 		goto err0;
+	}
 
 	bgc->gc.base = -1;
 	bgc->gc.ngpio = (u16)(uintptr_t)of_id->data;

^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2015-02-09  5:29 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-01-28 19:13 [patch] gpio: ge: fix error code in gef_gpio_probe() Dan Carpenter
2015-02-09  5:29 ` Alexandre Courbot

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox