Re: [PATCH] watchdog: sp5100_tco: Fix pci_dev reference leak in sp5100_tco_init()

From: Guenter Roeck

Date: Wed Sep 16 2026 - 20:26:29 EST


On Wed, Sep 16, 2026 at 05:05:11PM +0000, Wentao Liang wrote:
> sp5100_tco_init() stores the PCI device matched by for_each_pci_dev()
> in the global sp5100_tco_pci and keeps its reference for the lifetime
> of the driver, but neither sp5100_tco_exit() nor the error paths of
> sp5100_tco_init() call pci_dev_put(), leaking the reference on driver
> registration failure and on every module load/unload cycle.
>
> Drop the reference when the platform driver or device registration
> fails and when the module is unloaded.
>
> Fixes: 15e28bf13008 ("watchdog: Add support for sp5100 chipset TCO")
> Cc: stable@xxxxxxxxxxxxxxx
> Signed-off-by: Wentao Liang <vulab@xxxxxxxxxxx>

Applied.

Thanks,
Guenter