Skip to content

Commit

Permalink
usb: host: ohci-ppc-of: Fix refcount leak bug
Browse files Browse the repository at this point in the history
[ Upstream commit 40a959d ]

In ohci_hcd_ppc_of_probe(), of_find_compatible_node() will return
a node pointer with refcount incremented. We should use of_node_put()
when it is not used anymore.

Acked-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Liang He <windhl@126.com>
Link: https://lore.kernel.org/r/20220617034637.4003115-1-windhl@126.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
  • Loading branch information
Liang He authored and Greg Kroah-Hartman committed Aug 25, 2022
1 parent f465d46 commit fe6fe64
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions drivers/usb/host/ohci-ppc-of.c
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,7 @@ static int ohci_hcd_ppc_of_probe(struct platform_device *op)
release_mem_region(res.start, 0x4);
} else
pr_debug("%s: cannot get ehci offset from fdt\n", __FILE__);
of_node_put(np);
}

irq_dispose_mapping(irq);
Expand Down

0 comments on commit fe6fe64

Please sign in to comment.