[PATCH] gpio: tegra: return -ENOMEM on allocation failure in probe
From: Samasth Norway Ananda
Date: Thu Apr 09 2026 - 14:59:20 EST
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@xxxxxxxxxx>
---
drivers/gpio/gpio-tegra.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/gpio/gpio-tegra.c b/drivers/gpio/gpio-tegra.c
index b14052fe64ac..df06b56a2ade 100644
--- a/drivers/gpio/gpio-tegra.c
+++ b/drivers/gpio/gpio-tegra.c
@@ -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;
--
2.50.1