Skip to contentSkip to conversation

tpm: uninitialized variable in read_log_of()

PATCH In review Dan Carpenter 2 participants 2 messages Nov 16, 2016

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 tpm: uninitialized variable in read_log_of()

"np" is supposed to be set to NULL at the start.

Fixes 4a45d9669ac1 ("tpm: replace of_find_node_by_name() with dev of_node propert")
drivers/char/tpm/tpm_of.c +1 -1
index 3af829f..904ed4a 100644
@@ -23,7 +23,7 @@
 
 int read_log_of(struct tpm_chip *chip)
 {
-	struct device_node *np;
+	struct device_node *np = NULL;
 	const u32 *sizep;
 	const u64 *basep;
 	struct tpm_bios_log *log;
#1 lore raw
Quoted 4 lines · Dan Carpenter

"np" is supposed to be set to NULL at the start.

Fixes 4a45d9669ac1 ("tpm: replace of_find_node_by_name() with dev of_node propert")

Colid King submitted a patch to fix this a couple of days ago so applied that. Anyway, thank you for noting this.

drivers/char/tpm/tpm_of.c line 29

Quoted 13 lines
drivers/char/tpm/tpm_of.c +1 -1
index 3af829f..904ed4a 100644
@@ -23,7 +23,7 @@
 
 int read_log_of(struct tpm_chip *chip)
 {
-	struct device_node *np;
+	struct device_node *np = NULL;
 	const u32 *sizep;
 	const u64 *basep;
 	struct tpm_bios_log *log;

/Jarkko