From: Randy Dunlap Date: Fri, 14 Jul 2006 07:24:28 +0000 (-0700) Subject: [PATCH] TPM: fix failure path leak X-Git-Tag: v2.6.18-rc2~33 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=2e82636a3dd8d3cf1ba87380608da4f6a0f6ec47;p=platform%2Fkernel%2Flinux-exynos.git [PATCH] TPM: fix failure path leak kfree(devname) on the misc_register() failure path. Otherwise it is lost forever. Signed-off-by: Randy Dunlap Cc: Kylene Jo Hall Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- diff --git a/drivers/char/tpm/tpm.c b/drivers/char/tpm/tpm.c index 6889e7db3aff..a082a2e34252 100644 --- a/drivers/char/tpm/tpm.c +++ b/drivers/char/tpm/tpm.c @@ -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; }