Skip to content

Commit f90fafe

Browse files
seehearfeelMarc Zyngier
authored andcommitted
irqchip/loongson-htpic: Remove redundant kfree operation
In the function htpic_of_init(), when kzalloc htpic fails, it should return -ENOMEM directly, no need to execute "goto" to kfree. Signed-off-by: Tiezhu Yang <[email protected]> Signed-off-by: Marc Zyngier <[email protected]> Link: https://lore.kernel.org/r/[email protected]
1 parent 52b350c commit f90fafe

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

drivers/irqchip/irq-loongson-htpic.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -93,10 +93,8 @@ int __init htpic_of_init(struct device_node *node, struct device_node *parent)
9393
}
9494

9595
htpic = kzalloc(sizeof(*htpic), GFP_KERNEL);
96-
if (!htpic) {
97-
err = -ENOMEM;
98-
goto out_free;
99-
}
96+
if (!htpic)
97+
return -ENOMEM;
10098

10199
htpic->base = of_iomap(node, 0);
102100
if (!htpic->base) {

0 commit comments

Comments
 (0)