From: Vladimir Zapolskiy Date: Tue, 30 Jun 2026 14:51:48 +0000 (+0300) Subject: gpio: timberdale: Return -ENOMEM on dynamic memory allocation in probe X-Git-Tag: v7.2-rc2~17^2~1 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=8d7e62d5e9b2d2ff146f472a9215d7e29c7e2307;p=thirdparty%2Fkernel%2Flinux.git 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") Signed-off-by: Vladimir Zapolskiy Link: https://patch.msgid.link/20260630145148.4081967-1-vz@kernel.org Signed-off-by: Bartosz Golaszewski --- diff --git a/drivers/gpio/gpio-timberdale.c b/drivers/gpio/gpio-timberdale.c index 78fe133f5d32..ec378a4220a7 100644 --- a/drivers/gpio/gpio-timberdale.c +++ b/drivers/gpio/gpio-timberdale.c @@ -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;