Skip to content

Commit

Permalink
[PATCH] TPM: fix failure path leak
Browse files Browse the repository at this point in the history
kfree(devname) on the misc_register() failure path.  Otherwise it is lost
forever.

Signed-off-by: Randy Dunlap <rdunlap@xenotime.net>
Cc: Kylene Jo Hall <kjhall@us.ibm.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
  • Loading branch information
Randy Dunlap authored and Linus Torvalds committed Jul 15, 2006
1 parent 3a5f5e4 commit 2e82636
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions drivers/char/tpm/tpm.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down

0 comments on commit 2e82636

Please sign in to comment.