瀏覽代碼

[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>
Randy Dunlap 19 年之前
父節點
當前提交
2e82636a3d
共有 1 個文件被更改,包括 1 次插入0 次删除
  1. 1 0
      drivers/char/tpm/tpm.c

+ 1 - 0
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);
 		put_device(dev);
 		clear_bit(chip->dev_num, dev_mask);
 		clear_bit(chip->dev_num, dev_mask);
 		kfree(chip);
 		kfree(chip);
+		kfree(devname);
 		return NULL;
 		return NULL;
 	}
 	}