Message ID | 458b1c8b-1885-6583-f45d-7548ce65bb33@gmail.com |
---|---|
State | New |
Headers | show |
Series | i2c: i801: unregister tco_pdev in i801_probe() error path | expand |
On Thu, Sep 14, 2023 at 11:08:44PM +0200, Heiner Kallweit wrote: > We have to unregister tco_pdev also if i2c_add_adapter() fails. > > Fixes: 9424693035a5 ("i2c: i801: Create iTCO device on newer Intel PCHs") > Cc: stable@vger.kernel.org > Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com> Reviewed-by: Mika Westerberg <mika.westerberg@linux.intel.com>
On Thu, Sep 14, 2023 at 11:08:44PM +0200, Heiner Kallweit wrote: > We have to unregister tco_pdev also if i2c_add_adapter() fails. > > Fixes: 9424693035a5 ("i2c: i801: Create iTCO device on newer Intel PCHs") > Cc: stable@vger.kernel.org > Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com> Applied to for-current, thanks!
diff --git a/drivers/i2c/busses/i2c-i801.c b/drivers/i2c/busses/i2c-i801.c index f53be242f..9bd712eaf 100644 --- a/drivers/i2c/busses/i2c-i801.c +++ b/drivers/i2c/busses/i2c-i801.c @@ -1753,6 +1753,7 @@ static int i801_probe(struct pci_dev *dev, const struct pci_device_id *id) "SMBus I801 adapter at %04lx", priv->smba); err = i2c_add_adapter(&priv->adapter); if (err) { + platform_device_unregister(priv->tco_pdev); i801_acpi_remove(priv); return err; }
We have to unregister tco_pdev also if i2c_add_adapter() fails. Fixes: 9424693035a5 ("i2c: i801: Create iTCO device on newer Intel PCHs") Cc: stable@vger.kernel.org Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com> --- drivers/i2c/busses/i2c-i801.c | 1 + 1 file changed, 1 insertion(+)