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

2022-11-20 Thread Yang Yingliang
On 2022/11/21 14:31, Andrew Donnellan wrote: On Sat, 2022-11-19 at 22:44 +0800, Yang Yingliang wrote: As comment of pci_get_domain_bus_and_slot() says, it returns a pci device with refcount increment, so when finish using it, pci_dev_put() needs be called. In get_dvsec_vendor0(), in normal pa

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

2022-11-20 Thread Yang Yingliang
Hi, On 2022/11/21 14:28, Christophe Leroy wrote: Le 19/11/2022 à 15:44, Yang Yingliang a écrit : As comment of pci_get_domain_bus_and_slot() says, it returns a pci device with refcount increment, so when finish using it, pci_dev_put() needs be called. In get_dvsec_vendor0(), in normal path, t

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

2022-11-20 Thread Andrew Donnellan
On Sat, 2022-11-19 at 22:44 +0800, Yang Yingliang wrote: > As comment of pci_get_domain_bus_and_slot() says, it returns > a pci device with refcount increment, so when finish using it, > pci_dev_put() needs be called. > > In get_dvsec_vendor0(), in normal path, the returned pci device > is passed

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

2022-11-20 Thread Christophe Leroy
Le 19/11/2022 à 15:44, Yang Yingliang a écrit : > As comment of pci_get_domain_bus_and_slot() says, it returns > a pci device with refcount increment, so when finish using it, > pci_dev_put() needs be called. > > In get_dvsec_vendor0(), in normal path, the returned pci device > is passed to dev0

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

2022-11-19 Thread Yang Yingliang
As comment of pci_get_domain_bus_and_slot() says, it returns a pci device with refcount increment, so when finish using it, pci_dev_put() needs be called. In get_dvsec_vendor0(), in normal path, the returned pci device is passed to dev0, so after using dev0 in the callers, it need be put, in error