Skip to content

Commit ced01b9

Browse files
jgunthorpeJarkko Sakkinen
authored andcommitted
tpm: Fix IRQ unwind ordering in TIS
The devm for the IRQ was placed on the chip, not the pdev. This can cause the irq to be still callable after the pdev has been cleaned up (eg priv kfree'd). Found by CONFIG_DEBUG_SHIRQ=y Reported-by: Stefan Berger <stefanb@linux.vnet.ibm.com> Fixes: 233a065 ("tpm: Get rid of chip->pdev") Signed-off-by: Jason Gunthorpe <jgunthorpe@obsidianresearch.com> Tested-by: Stefan Berger <stefanb@linux.vnet.ibm.com> Reviewed-by: Jarkko Sakkinen <jarkko.sakkinen@linux.intel.com> Signed-off-by: Jarkko Sakkinen <jarkko.sakkinen@linux.intel.com>
1 parent 7e1dc00 commit ced01b9

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

drivers/char/tpm/tpm_tis.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -387,7 +387,7 @@ static void disable_interrupts(struct tpm_chip *chip)
387387
intmask &= ~TPM_GLOBAL_INT_ENABLE;
388388
iowrite32(intmask,
389389
priv->iobase + TPM_INT_ENABLE(priv->locality));
390-
devm_free_irq(&chip->dev, priv->irq, chip);
390+
devm_free_irq(chip->dev.parent, priv->irq, chip);
391391
priv->irq = 0;
392392
chip->flags &= ~TPM_CHIP_FLAG_IRQ;
393393
}
@@ -604,7 +604,7 @@ static int tpm_tis_probe_irq_single(struct tpm_chip *chip, u32 intmask,
604604
struct priv_data *priv = dev_get_drvdata(&chip->dev);
605605
u8 original_int_vec;
606606

607-
if (devm_request_irq(&chip->dev, irq, tis_int_handler, flags,
607+
if (devm_request_irq(chip->dev.parent, irq, tis_int_handler, flags,
608608
dev_name(&chip->dev), chip) != 0) {
609609
dev_info(&chip->dev, "Unable to request irq: %d for probe\n",
610610
irq);

0 commit comments

Comments
 (0)