]> git.baikalelectronics.ru Git - kernel.git/commit
ixgbe: fix pci device refcount leak
authorYang Yingliang <yangyingliang@huawei.com>
Tue, 29 Nov 2022 01:57:48 +0000 (09:57 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 18 Jan 2023 10:42:02 +0000 (11:42 +0100)
commitd30ca6999ddf1fab69b5262822c52387dc698a88
tree69d8f227aef24df787d36778f6b73f7f931ba73c
parentfb780bd85b740f1e30fec26123cb6908dda03af6
ixgbe: fix pci device refcount leak

commit b93fb4405fcb5112c5739c5349afb52ec7f15c07 upstream.

As the comment of pci_get_domain_bus_and_slot() says, it
returns a PCI device with refcount incremented, when finish
using it, the caller must decrement the reference count by
calling pci_dev_put().

In ixgbe_get_first_secondary_devfn() and ixgbe_x550em_a_has_mii(),
pci_dev_put() is called to avoid leak.

Fixes: 684a96d07ffc ("ixgbe: register a mdiobus")
Signed-off-by: Yang Yingliang <yangyingliang@huawei.com>
Tested-by: Gurucharan G <gurucharanx.g@intel.com> (A Contingent worker at Intel)
Signed-off-by: Tony Nguyen <anthony.l.nguyen@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/net/ethernet/intel/ixgbe/ixgbe_phy.c