Skip to content

Commit 9be8bc4

Browse files
jhnikulaWolfram Sang
authored andcommitted
i2c: designware-pci: Fix BUG_ON during device removal
Function i2c_dw_pci_remove() -> pci_free_irq_vectors() -> pci_disable_msi() -> free_msi_irqs() will throw a BUG_ON() for MSI enabled device since the driver has not released the requested IRQ before calling the pci_free_irq_vectors(). Here driver requests an IRQ using devm_request_irq() but automatic release happens only after remove callback. Fix this by explicitly freeing the IRQ before calling pci_free_irq_vectors(). Fixes: 21aa398 ("i2c: designware-pci: Switch over to MSI interrupts") Cc: [email protected] # v5.4+ Signed-off-by: Jarkko Nikula <[email protected]> Reviewed-by: Andy Shevchenko <[email protected]> Signed-off-by: Wolfram Sang <[email protected]>
1 parent 04bbb97 commit 9be8bc4

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

drivers/i2c/busses/i2c-designware-pcidrv.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -313,6 +313,7 @@ static void i2c_dw_pci_remove(struct pci_dev *pdev)
313313
pm_runtime_get_noresume(&pdev->dev);
314314

315315
i2c_del_adapter(&dev->adapter);
316+
devm_free_irq(&pdev->dev, dev->irq, dev);
316317
pci_free_irq_vectors(pdev);
317318
}
318319

0 commit comments

Comments
 (0)