[PATCH] TPM: fix failure path leak

From: Randy.Dunlap
Date: Wed Jul 12 2006 - 21:14:01 EST


From: Randy Dunlap <rdunlap@xxxxxxxxxxxx>

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

Signed-off-by: Randy Dunlap <rdunlap@xxxxxxxxxxxx>
---
drivers/char/tpm/tpm.c | 1 +
1 files changed, 1 insertion(+)

--- linux-2618-rc1mm1.orig/drivers/char/tpm/tpm.c
+++ linux-2618-rc1mm1/drivers/char/tpm/tpm.c
@@ -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;
}



---
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/