Re: [PATCH v2] ocxl: fix pci device refcount leak when calling get_function_0()

2022-11-30 Thread Michael Ellerman
On Mon, 21 Nov 2022 23:43:39 +0800, Yang Yingliang wrote: > get_function_0() calls pci_get_domain_bus_and_slot(), as comment > says, it returns a pci device with refcount increment, so after > using it, pci_dev_put() needs be called. > > Get the device reference when get_function_0() is not called

Re: [PATCH v2] ocxl: fix pci device refcount leak when calling get_function_0()

2022-11-24 Thread Frederic Barrat
On 21/11/2022 16:43, Yang Yingliang wrote: get_function_0() calls pci_get_domain_bus_and_slot(), as comment says, it returns a pci device with refcount increment, so after using it, pci_dev_put() needs be called. Get the device reference when get_function_0() is not called, so pci_dev_put() c

Re: [PATCH v2] ocxl: fix pci device refcount leak when calling get_function_0()

2022-11-21 Thread Andrew Donnellan
On Mon, 2022-11-21 at 23:43 +0800, Yang Yingliang wrote: > get_function_0() calls pci_get_domain_bus_and_slot(), as comment > says, it returns a pci device with refcount increment, so after > using it, pci_dev_put() needs be called. > > Get the device reference when get_function_0() is not called,

[PATCH v2] ocxl: fix pci device refcount leak when calling get_function_0()

2022-11-21 Thread Yang Yingliang
get_function_0() calls pci_get_domain_bus_and_slot(), as comment says, it returns a pci device with refcount increment, so after using it, pci_dev_put() needs be called. Get the device reference when get_function_0() is not called, so pci_dev_put() can be called in the error path and callers uncon