Re: [PATCH net 2/3] net: fealnx: disable the PCI device on remove and probe failure
From: Francois Romieu
Date: Thu Sep 24 2026 - 17:55:41 EST
Жамбакиев Радий Рикардинович <r.zhambakiev@xxxxxxxxxxxxxxxxx> :
> From: Radiy Zhambakiev <r.zhambakiev@xxxxxxxxxxxxxxxxx>
>
> pci_enable_device() is called in probe, but the device is never
> disabled on probe failure or remove. Device remains enabled and
> bus mastering stays active.
>
> Add pci_disable_device() to the probe error unwind and to
> fealnx_remove_one(), after all other resources have been released.
>
> Found by Linux Verification Center (linuxtesting.org)
>
> Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2")
> Cc: stable@xxxxxxxxxxxxxxx
> Signed-off-by: Radiy Zhambakiev <r.zhambakiev@xxxxxxxxxxxxxxxxx>
> ---
> drivers/net/ethernet/fealnx.c | 17 +++++++++++------
> 1 file changed, 11 insertions(+), 6 deletions(-)
>
> diff --git a/drivers/net/ethernet/fealnx.c b/drivers/net/ethernet/fealnx.c
> index d7cd1644a375..46a40d00b59a 100644
> --- a/drivers/net/ethernet/fealnx.c
> +++ b/drivers/net/ethernet/fealnx.c
> @@ -494,20 +494,22 @@ static int fealnx_init_one(struct pci_dev *pdev,
>
> option = card_idx < MAX_UNITS ? options[card_idx] : 0;
>
> - i = pci_enable_device(pdev);
> - if (i) return i;
> + err = pci_enable_device(pdev);
> + if (err)
> + return err;
Unrelated change.
--
Ueimor