[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20161115155736.599954-1-arnd@arndb.de>
Date:   Tue, 15 Nov 2016 16:57:11 +0100
From:   Arnd Bergmann <arnd@...db.de>
To:     Jarkko Sakkinen <jarkko.sakkinen@...ux.intel.com>
Cc:     Arnd Bergmann <arnd@...db.de>, Peter Huewe <peterhuewe@....de>,
        Marcel Selhorst <tpmdd@...horst.net>,
        Jason Gunthorpe <jgunthorpe@...idianresearch.com>,
        Nayna Jain <nayna@...ux.vnet.ibm.com>,
        tpmdd-devel@...ts.sourceforge.net, linux-kernel@...r.kernel.org
Subject: [PATCH] tpm: fix node pointer lookup
A rework left the node pointer uninitialized when the device tree
is not in use:
drivers/char/tpm/tpm_of.c: In function 'read_log_of':
drivers/char/tpm/tpm_of.c:37:8: error: 'np' may be used uninitialized in this function [-Werror=maybe-uninitialized]
This reverts the behavior to what it should be.
Fixes: 4a45d9669ac1 ("tpm: replace of_find_node_by_name() with dev of_node property")
Signed-off-by: Arnd Bergmann <arnd@...db.de>
---
 drivers/char/tpm/tpm_of.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/drivers/char/tpm/tpm_of.c b/drivers/char/tpm/tpm_of.c
index 3af829f3ad59..24fa6afc2e55 100644
--- a/drivers/char/tpm/tpm_of.c
+++ b/drivers/char/tpm/tpm_of.c
@@ -29,8 +29,7 @@ int read_log_of(struct tpm_chip *chip)
 	struct tpm_bios_log *log;
 
 	log = &chip->log;
-	if (chip->dev.parent->of_node)
-		np = chip->dev.parent->of_node;
+	np = chip->dev.parent->of_node;
 	if (!np)
 		return -ENODEV;
 
-- 
2.9.0
Powered by blists - more mailing lists
 
