[PATCH] TPM: fix failure path leak
authorRandy Dunlap <[email protected]>
Fri, 14 Jul 2006 07:24:28 +0000 (00:24 -0700)
committerLinus Torvalds <[email protected]>
Sat, 15 Jul 2006 04:53:55 +0000 (21:53 -0700)
kfree(devname) on the misc_register() failure path.  Otherwise it is lost
forever.

Signed-off-by: Randy Dunlap <[email protected]>
Cc: Kylene Jo Hall <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
drivers/char/tpm/tpm.c

index 6889e7db3aff5285dd7824317c3f6469fc2e00c2..a082a2e342522a78edfd642f272784bd1fbee276 100644 (file)
@@ -1141,6 +1141,7 @@ struct tpm_chip *tpm_register_hardware(struct device *dev, const struct tpm_vend
                put_device(dev);
                clear_bit(chip->dev_num, dev_mask);
                kfree(chip);
+               kfree(devname);
                return NULL;
        }