From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933387AbcKORgJ (ORCPT ); Tue, 15 Nov 2016 12:36:09 -0500 Received: from mga06.intel.com ([134.134.136.31]:53442 "EHLO mga06.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932176AbcKORgH (ORCPT ); Tue, 15 Nov 2016 12:36:07 -0500 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.31,495,1473145200"; d="scan'208";a="1059809463" Date: Tue, 15 Nov 2016 09:36:09 -0800 From: Jarkko Sakkinen To: Arnd Bergmann Cc: Peter Huewe , Marcel Selhorst , Jason Gunthorpe , Nayna Jain , tpmdd-devel@lists.sourceforge.net, linux-kernel@vger.kernel.org Subject: Re: [PATCH] tpm: fix node pointer lookup Message-ID: <20161115173609.6d625ksyv7rppeci@intel.com> References: <20161115155736.599954-1-arnd@arndb.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20161115155736.599954-1-arnd@arndb.de> Organization: Intel Finland Oy - BIC 0357606-4 - Westendinkatu 7, 02160 Espoo User-Agent: Mutt/1.6.2-neo (2016-08-21) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Nov 15, 2016 at 04:57:11PM +0100, Arnd Bergmann wrote: > 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, I got patch from Colin a moment earlier so I applied that. Thank you in any case! /Jarkko > --- > 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 >