From patchwork Tue Nov 15 15:57:11 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 9430131 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id E965D60484 for ; Tue, 15 Nov 2016 15:58:14 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id D8E81286A2 for ; Tue, 15 Nov 2016 15:58:14 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id CDBCC286AA; Tue, 15 Nov 2016 15:58:14 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.4 required=2.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RCVD_IN_SORBS_SPAM autolearn=ham version=3.3.1 Received: from lists.sourceforge.net (lists.sourceforge.net [216.34.181.88]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 65B61286A2 for ; Tue, 15 Nov 2016 15:58:14 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=sfs-ml-4.v29.ch3.sourceforge.com) by sfs-ml-4.v29.ch3.sourceforge.com with esmtp (Exim 4.76) (envelope-from ) id 1c6g7g-0000HF-3b; Tue, 15 Nov 2016 15:58:12 +0000 Received: from sog-mx-2.v43.ch3.sourceforge.com ([172.29.43.192] helo=mx.sourceforge.net) by sfs-ml-4.v29.ch3.sourceforge.com with esmtp (Exim 4.76) (envelope-from ) id 1c6g7e-0000HA-M5 for tpmdd-devel@lists.sourceforge.net; Tue, 15 Nov 2016 15:58:10 +0000 X-ACL-Warn: Received: from mout.kundenserver.de ([212.227.126.131]) by sog-mx-2.v43.ch3.sourceforge.com with esmtp (Exim 4.76) id 1c6g7Z-0005SI-E2 for tpmdd-devel@lists.sourceforge.net; Tue, 15 Nov 2016 15:58:10 +0000 Received: from wuerfel.lan ([78.43.21.235]) by mrelayeu.kundenserver.de (mreue005 [212.227.15.129]) with ESMTPA (Nemesis) id 0LeQLR-1caCYz1Wwv-00q9cK; Tue, 15 Nov 2016 16:57:40 +0100 From: Arnd Bergmann To: Jarkko Sakkinen Date: Tue, 15 Nov 2016 16:57:11 +0100 Message-Id: <20161115155736.599954-1-arnd@arndb.de> X-Mailer: git-send-email 2.9.0 X-Provags-ID: V03:K0:A5qZ+wM8i5CLQKTumYDQgeDmdFeLCEWnvhCWi+GhBlfdc+snjZ+ Q6MGxVRPAq/OGJTHJNK8ZNTqATdeVrLcPFJ12aJAIJPCPzTkxpLxAQkKhQPMfofRKd7/+NC +tlIPqPz5fr1Fwz/qEVpTjlqSIyUSRdvUTKdmy1h17C5Wl+r2aU8Z7rIjx/fnvR1OR/G3tX KBuHFhSfeeH0cAM+XaRog== X-UI-Out-Filterresults: notjunk:1; V01:K0:bgqi7i2HAt8=:Z9SmEERtaRlTJko9qo1qkG TufmYNCqn4kHoNr5ZE2HeTVV9jBu/1g5bGmZsKXrv2lATV0uMomdBNvpyE4PhXQ0wYbmbxMyL fv48VgXSSbtgJFeBH4k6AqY3KjFAZtw1/IKrawMLsrV/b2FeOkpVv64DgTrLSD1ZXwVIuO3Cq dcO2h0VdZ2l+Pq9GLFVg8e9Ga7CRRQmjwVKoPQOrxw9LiSWYTIRmEXOaQNFqvc89BN0PNkl6j ztBFDnI6eiO6fyCAFeeXxhHTAeDmfxn9DTVKO/havgFhHVcaeeuN8+1gl+IL25K/kyT9bwZRG 5juWWtKktqxy7aJSHt5D5549XZgpT+13XCf1PqdauFvGgATaHUvMI/N4pLTkrJDC3i5NCiHtZ UzfUTt6kKDfpsFTJlWnbzOYBvJwipFnPVsqRUrbptmB8VOe4/RiNySy69Rrt3sZjBbDYvzJm2 qqmqWu5EOWkJlHwpR8JxTKB/JBSoEsmib9tXFKnBBKtgxV12wycRwv6P4Cs82VBJykQ6f6LgB X9ZsKpPAsqZ2nQ3HoI+g1G2YfDNQLS+LSvOEqbLcDxTn4YGMDu3JyHd0L8fT2tLPPPFJcJvto hegCR5dsGnN3Iv3gfzSOv25hkJ/22gHCUw5KEYvKGqIZzpoBiNogsGFmGV/6f0GvFkPmvNx7D 9wnRSOlpJfPrEUL7TkpSNPWW50CSoniG6Z5xE6nq2sibmWgHYK8bNn70eyNsY32yA3eI= X-Headers-End: 1c6g7Z-0005SI-E2 Cc: Arnd Bergmann , linux-kernel@vger.kernel.org, tpmdd-devel@lists.sourceforge.net Subject: [tpmdd-devel] [PATCH] tpm: fix node pointer lookup X-BeenThere: tpmdd-devel@lists.sourceforge.net X-Mailman-Version: 2.1.9 Precedence: list List-Id: Tpm Device Driver maintainance List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: tpmdd-devel-bounces@lists.sourceforge.net X-Virus-Scanned: ClamAV using ClamSMTP 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 --- 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;