[PATCH] powerpc: kernel: pci-common: Fix refcount bug for 'phb->dn'

Michael Ellerman patch-notifications at ellerman.id.au
Fri Sep 9 22:07:27 AEST 2022


On Sat, 2 Jul 2022 10:29:36 +0800, Liang He wrote:
> In pcibios_alloc_controller(), 'phb' is allocated and escaped into
> global 'hose_list'. So we should call of_node_get() when a new reference
> created into 'phb->dn'. And when phb is freed, we should call
> of_node_put() on it.
> 
> NOTE: This function is called in the iteration of for_each_xx in
> chrp_find_bridges() function. If there is no of_node_get(), the object
> maybe prematurely freed.
> 
> [...]

Applied to powerpc/next.

[1/1] powerpc: kernel: pci-common: Fix refcount bug for 'phb->dn'
      https://git.kernel.org/powerpc/c/ce63c44b63cdae892107717ba10fdb6fb4fc6cdb

cheers


More information about the Linuxppc-dev mailing list