[PATCH] TPM: fix failure path leak
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>
This commit is contained in:
parent
3a5f5e488c
commit
2e82636a3d
1 changed files with 1 additions and 0 deletions
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue