Skip to contentSkip to conversation

TPM: fix failure path leak

PATCH New Randy.Dunlap 1 participant 1 message Jul 13, 2006 TPM device driver

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 TPM: fix failure path leak

From: Randy Dunlap <[email protected]>

kfree(devname) on the misc_register() failure path. Otherwise it is lost forever.

---
 drivers/char/tpm/tpm.c |    1 +
 1 files changed, 1 insertion(+)
drivers/char/tpm/tpm.c +1 -0
@@ -1141,6 +1141,7 @@ struct tpm_chip *tpm_register_hardware(s
 		put_device(dev);
 		clear_bit(chip->dev_num, dev_mask);
 		kfree(chip);
+		kfree(devname);
 		return NULL;
 	}
 

---