projects/linux·commit 57df6923

gpio: tegra: return -ENOMEM on allocation failure in probe

57df6923 · Samasth Norway Ananda <[email protected]> · 2026-04-09 11:58:53 -07:00

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 <[email protected]>
Link: https://patch.msgid.link/[email protected]
Signed-off-by: Bartosz Golaszewski <[email protected]>
Commit
57df6923ca53b524d06d2347b896d9de74b3bc86
Parents
1561d96f

Changes

1 files changed · +1 −1

FileStatusAddDelContent
drivers/gpio/gpio-tegra.cmodified+1−1View file

drivers/gpio/gpio-tegra.c

View file
diff --git a/drivers/gpio/gpio-tegra.c b/drivers/gpio/gpio-tegra.c
index b14052f..df06b56 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;