Skip to content

Commit

Permalink
mips: ralink: fix a refcount leak in ill_acc_of_setup()
Browse files Browse the repository at this point in the history
of_node_put(np) needs to be called when pdev == NULL.

Signed-off-by: Hangyu Hua <hbh25y@gmail.com>
Signed-off-by: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
  • Loading branch information
Hangyu Hua authored and Thomas Bogendoerfer committed Mar 1, 2022
1 parent 200ed34 commit 4a0a143
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions arch/mips/ralink/ill_acc.c
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ static int __init ill_acc_of_setup(void)
pdev = of_find_device_by_node(np);
if (!pdev) {
pr_err("%pOFn: failed to lookup pdev\n", np);
of_node_put(np);
return -EINVAL;
}

Expand Down

0 comments on commit 4a0a143

Please sign in to comment.