drivers/gpio/gpio-loongson-64bit.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
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@iscas.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
On Thu, 05 Feb 2026 15:26:49 +0800, Chen Ni wrote:
> Fix incorrect NULL check in loongson_gpio_init_irqchip().
> The function checks chip->parent instead of chip->irq.parents.
>
>
Applied, thanks!
[1/1] gpio: loongson-64bit: Fix NULL check after devm_kcalloc() in loongson_gpio_init_irqchip()
https://git.kernel.org/brgl/c/e34f77b09080c86c929153e2a72da26b4f8947ff
Best regards,
--
Bartosz Golaszewski <bartosz.golaszewski@oss.qualcomm.com>
> Fix incorrect NULL check in loongson_gpio_init_irqchip(). … * Were any source code analysis tools involved here? * See also once more: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/Documentation/process/stable-kernel-rules.rst?h=v6.19-rc8#n34 Regards, Markus
© 2016 - 2026 Red Hat, Inc.