mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Jarkko Sakkinen <jarkko.sakkinen@linux.intel.com>
To: "Gustavo A. R. Silva" <garsilva@embeddedor.com>
Cc: Peter Huewe <peterhuewe@gmx.de>,
	Marcel Selhorst <tpmdd@selhorst.net>,
	Jason Gunthorpe <jgunthorpe@obsidianresearch.com>,
	tpmdd-devel@lists.sourceforge.net, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] char: tpm: remove unnecessary NULL check
Date: Wed, 14 Jun 2017 11:46:09 +0200	[thread overview]
Message-ID: <20170614094609.yop3p25riqzop6ft@intel.com> (raw)
In-Reply-To: <20170613195542.GA5677@embeddedgus>

On Tue, Jun 13, 2017 at 02:55:42PM -0500, Gustavo A. R. Silva wrote:
> Remove unnecessary NULL check.
> Pointer _chip_ cannot be NULL in this instance.
> 
> Addresses-Coverity-ID: 1397646
> Cc: Jarkko Sakkinen <jarkko.sakkinen@linux.intel.com>
> Signed-off-by: Gustavo A. R. Silva <garsilva@embeddedor.com>
> ---
>  drivers/char/tpm/tpm_atmel.c | 12 +++++-------
>  1 file changed, 5 insertions(+), 7 deletions(-)
> 
> diff --git a/drivers/char/tpm/tpm_atmel.c b/drivers/char/tpm/tpm_atmel.c
> index 0d322ab..66a1452 100644
> --- a/drivers/char/tpm/tpm_atmel.c
> +++ b/drivers/char/tpm/tpm_atmel.c
> @@ -144,13 +144,11 @@ static void atml_plat_remove(void)
>  	struct tpm_chip *chip = dev_get_drvdata(&pdev->dev);
>  	struct tpm_atmel_priv *priv = dev_get_drvdata(&chip->dev);
>  
> -	if (chip) {
> -		tpm_chip_unregister(chip);
> -		if (priv->have_region)
> -			atmel_release_region(priv->base, priv->region_size);
> -		atmel_put_base_addr(priv->iobase);
> -		platform_device_unregister(pdev);
> -	}
> +	tpm_chip_unregister(chip);
> +	if (priv->have_region)
> +		atmel_release_region(priv->base, priv->region_size);
> +	atmel_put_base_addr(priv->iobase);
> +	platform_device_unregister(pdev);
>  }
>  
>  static SIMPLE_DEV_PM_OPS(tpm_atml_pm, tpm_pm_suspend, tpm_pm_resume);
> -- 
> 2.5.0
> 

Thank you.

Reviewed-by: Jarkko Sakkinen <jarkko.sakkinen@linux.intel.com>

/Jarkko

  reply	other threads:[~2017-06-14  9:46 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-05-30 21:51 [PATCH] char: tmp: fix potential null pointer dereference Gustavo A. R. Silva
2017-05-31 12:11 ` Jarkko Sakkinen
2017-06-12 22:25   ` Gustavo A. R. Silva
2017-06-13 18:03     ` Jarkko Sakkinen
2017-06-13 19:55       ` [PATCH] char: tpm: remove unnecessary NULL check Gustavo A. R. Silva
2017-06-14  9:46         ` Jarkko Sakkinen [this message]
2017-06-19  0:35         ` Jarkko Sakkinen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20170614094609.yop3p25riqzop6ft@intel.com \
    --to=jarkko.sakkinen@linux.intel.com \
    --cc=garsilva@embeddedor.com \
    --cc=jgunthorpe@obsidianresearch.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=peterhuewe@gmx.de \
    --cc=tpmdd-devel@lists.sourceforge.net \
    --cc=tpmdd@selhorst.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®