Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

i2c: amd-mp2: drop free_irq() of devm_request_irq() allocated irq

irq allocated with devm_request_irq() will be freed in devm_irq_release(),
using free_irq() in ->remove() will causes a dangling pointer, and a
subsequent double free. So remove the free_irq() in the error path and
remove path.

Fixes: 969864efae78 ("i2c: amd-mp2: use msix/msi if the hardware supports")
Signed-off-by: Yang Yingliang <yangyingliang@huawei.com>
Acked-by: Shyam Sundar S K <Shyam-sundar.S-k@amd.com>
Link: https://lore.kernel.org/r/20221103121146.99836-1-yangyingliang@huawei.com
Signed-off-by: Andi Shyti <andi.shyti@kernel.org>

authored by

Yang Yingliang and committed by
Andi Shyti
6ea39cc3 4701f33a

+1 -4
+1 -4
drivers/i2c/busses/i2c-amd-mp2-pci.c
··· 327 327 amd_mp2_irq_isr, irq_flag, dev_name(&pci_dev->dev), privdata); 328 328 if (rc) { 329 329 pci_err(pci_dev, "Failure requesting irq %i: %d\n", privdata->dev_irq, rc); 330 - goto free_irq_vectors; 330 + goto err_dma_mask; 331 331 } 332 332 333 333 return rc; 334 334 335 - free_irq_vectors: 336 - free_irq(privdata->dev_irq, privdata); 337 335 err_dma_mask: 338 336 pci_clear_master(pci_dev); 339 337 err_pci_enable: ··· 374 376 pm_runtime_forbid(&pci_dev->dev); 375 377 pm_runtime_get_noresume(&pci_dev->dev); 376 378 377 - free_irq(privdata->dev_irq, privdata); 378 379 pci_clear_master(pci_dev); 379 380 380 381 amd_mp2_clear_reg(privdata);