In the Linux kernel, the following vulnerability has been resolved: ocxl: fix pci device refcount leak when calling getfunction0() getfunction0() calls pcigetdomainbusandslot(), as comment says, it returns a pci device with refcount increment, so after using it, pcidevput() needs be called. Get the device reference when getfunction0() is not called, so pcidevput() can be called in the error path and callers unconditionally. And add comment above getdvsecvendor0() to tell callers to call pcidev_put().