]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
gpio: timberdale: Return -ENOMEM on dynamic memory allocation in probe
authorVladimir Zapolskiy <vz@kernel.org>
Tue, 30 Jun 2026 14:51:48 +0000 (17:51 +0300)
committerBartosz Golaszewski <bartosz.golaszewski@oss.qualcomm.com>
Wed, 1 Jul 2026 07:21:21 +0000 (09:21 +0200)
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 <vz@kernel.org>
Link: https://patch.msgid.link/20260630145148.4081967-1-vz@kernel.org
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@oss.qualcomm.com>
drivers/gpio/gpio-timberdale.c

index 78fe133f5d32350567c28a1cc982d7bb3183ff2b..ec378a4220a77f9af2ef8f198d60fa37544a5aca 100644 (file)
@@ -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;