Skip to contentSkip to conversation

gpio: timberdale: Return -ENOMEM on dynamic memory allocation in probe

PATCH Applied Vladimir Zapolskiy 2 participants 2 messages Jun 30 – Jul 1 GPIO

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 gpio: timberdale: Return -ENOMEM on dynamic memory allocation in probe

Out of memory situation on driver's probe is expected to be reported to the driver's framework with a proper -ENOMEM error code.

Fixes 35570ac6039e ("gpio: add GPIO driver for the Timberdale FPGA")
---
 drivers/gpio/gpio-timberdale.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpio/gpio-timberdale.c +1 -1
index 78fe133f5d32..ec378a4220a7 100644
@@ -228,7 +228,7 @@ static int timbgpio_probe(struct platform_device *pdev)
 
 	tgpio = devm_kzalloc(dev, sizeof(*tgpio), GFP_KERNEL);
 	if (!tgpio)
-		return -EINVAL;
+		return -ENOMEM;
 
 	gc = &tgpio->gpio;
 
Signature · 1 line
2.51.0