Skip to content

Commit e34f77b

Browse files
Chen NiBartosz Golaszewski
authored andcommitted
gpio: loongson-64bit: Fix incorrect NULL check after devm_kcalloc()
Fix incorrect NULL check in loongson_gpio_init_irqchip(). The function checks chip->parent instead of chip->irq.parents. Fixes: 03c146c ("gpio: loongson-64bit: Add support for Loongson-2K0300 SoC") Signed-off-by: Chen Ni <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Bartosz Golaszewski <[email protected]>
1 parent c62e065 commit e34f77b

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

drivers/gpio/gpio-loongson-64bit.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -263,7 +263,7 @@ static int loongson_gpio_init_irqchip(struct platform_device *pdev,
263263
chip->irq.num_parents = data->intr_num;
264264
chip->irq.parents = devm_kcalloc(&pdev->dev, data->intr_num,
265265
sizeof(*chip->irq.parents), GFP_KERNEL);
266-
if (!chip->parent)
266+
if (!chip->irq.parents)
267267
return -ENOMEM;
268268

269269
for (i = 0; i < data->intr_num; i++) {

0 commit comments

Comments
 (0)