[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20260205072649.3271158-1-nichen@iscas.ac.cn>
Date: Thu, 5 Feb 2026 15:26:49 +0800
From: Chen Ni <nichen@...as.ac.cn>
To: zhuyinbo@...ngson.cn,
linusw@...nel.org,
brgl@...nel.org,
ziyao@...root.org,
chenhuacai@...nel.org
Cc: linux-gpio@...r.kernel.org,
linux-kernel@...r.kernel.org,
Chen Ni <nichen@...as.ac.cn>
Subject: [PATCH] gpio: loongson-64bit: Fix NULL check after devm_kcalloc() in loongson_gpio_init_irqchip()
Fix incorrect NULL check in loongson_gpio_init_irqchip().
The function checks chip->parent instead of chip->irq.parents.
Fixes: 03c146cb6cd1 ("gpio: loongson-64bit: Add support for Loongson-2K0300 SoC")
Signed-off-by: Chen Ni <nichen@...as.ac.cn>
---
drivers/gpio/gpio-loongson-64bit.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/gpio/gpio-loongson-64bit.c b/drivers/gpio/gpio-loongson-64bit.c
index 77d07e31366f..0fdf15faa344 100644
--- a/drivers/gpio/gpio-loongson-64bit.c
+++ b/drivers/gpio/gpio-loongson-64bit.c
@@ -263,7 +263,7 @@ static int loongson_gpio_init_irqchip(struct platform_device *pdev,
chip->irq.num_parents = data->intr_num;
chip->irq.parents = devm_kcalloc(&pdev->dev, data->intr_num,
sizeof(*chip->irq.parents), GFP_KERNEL);
- if (!chip->parent)
+ if (!chip->irq.parents)
return -ENOMEM;
for (i = 0; i < data->intr_num; i++) {
--
2.25.1
Powered by blists - more mailing lists