]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
gpio: tegra: return -ENOMEM on allocation failure in probe
authorSamasth Norway Ananda <samasth.norway.ananda@oracle.com>
Thu, 9 Apr 2026 18:58:53 +0000 (11:58 -0700)
committerBartosz Golaszewski <bartosz.golaszewski@oss.qualcomm.com>
Fri, 10 Apr 2026 07:01:24 +0000 (09:01 +0200)
devm_kzalloc() failure in tegra_gpio_probe() returns -ENODEV, which
indicates "no such device". The correct error code for a memory
allocation failure is -ENOMEM.

Signed-off-by: Samasth Norway Ananda <samasth.norway.ananda@oracle.com>
Link: https://patch.msgid.link/20260409185853.2163034-1-samasth.norway.ananda@oracle.com
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@oss.qualcomm.com>
drivers/gpio/gpio-tegra.c

index b14052fe64ac69bcc485b6ddcaa3237d0ecf6ab3..df06b56a2ade8543f4285665be66187259b3f88a 100644 (file)
@@ -698,7 +698,7 @@ static int tegra_gpio_probe(struct platform_device *pdev)
 
        tgi = devm_kzalloc(&pdev->dev, sizeof(*tgi), GFP_KERNEL);
        if (!tgi)
-               return -ENODEV;
+               return -ENOMEM;
 
        tgi->soc = of_device_get_match_data(&pdev->dev);
        tgi->dev = &pdev->dev;