All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jarkko Sakkinen <jarkko.sakkinen-VuQAYsv1563Yd54FQh9/CA@public.gmane.org>
To: Stefan Berger
	<stefanb-23VcF4HTsmIX0ybBhKVfKdBPR1lH4CV8@public.gmane.org>
Cc: tpmdd-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org
Subject: Re: [PATCH 1/2] tpm: Check for parent device being NULL
Date: Fri, 18 Nov 2016 07:52:00 -0800	[thread overview]
Message-ID: <20161118155200.czodzutm72aqfb77@intel.com> (raw)
In-Reply-To: <1479429004-7962-1-git-send-email-stefanb-23VcF4HTsmIX0ybBhKVfKdBPR1lH4CV8@public.gmane.org>

On Thu, Nov 17, 2016 at 07:30:03PM -0500, Stefan Berger wrote:
> Check for the parent device being NULL before accessing it. This
> prevents crashed with the vtpm_proxy driver, since this driver
> does not have a parent device.
> 
> Signed-off-by: Stefan Berger <stefanb-23VcF4HTsmIX0ybBhKVfKdBPR1lH4CV8@public.gmane.org>
> ---
>  drivers/char/tpm/tpm_of.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/char/tpm/tpm_of.c b/drivers/char/tpm/tpm_of.c
> index 36df9df..72c282e 100644
> --- a/drivers/char/tpm/tpm_of.c
> +++ b/drivers/char/tpm/tpm_of.c
> @@ -29,7 +29,7 @@ int tpm_read_log_of(struct tpm_chip *chip)
>  	struct tpm_bios_log *log;
>  
>  	log = &chip->log;
> -	if (chip->dev.parent->of_node)
> +	if (chip->dev.parent && chip->dev.parent->of_node)
>  		np = chip->dev.parent->of_node;
>  	else
>  		return -ENODEV;
> -- 
> 2.4.3

CC to linux-security-module

LGTM

Reviewed-by: Jarkko Sakkinen <jarkko.sakkinen-VuQAYsv1563Yd54FQh9/CA@public.gmane.org>

/Jarkko

------------------------------------------------------------------------------

      parent reply	other threads:[~2016-11-18 15:52 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-11-18  0:30 [PATCH 1/2] tpm: Check for parent device being NULL Stefan Berger
     [not found] ` <1479429004-7962-1-git-send-email-stefanb-23VcF4HTsmIX0ybBhKVfKdBPR1lH4CV8@public.gmane.org>
2016-11-18  0:30   ` [PATCH 2/2] tpm: Fix error code handling after tpm_bios_log_setup Stefan Berger
     [not found]     ` <1479429004-7962-2-git-send-email-stefanb-23VcF4HTsmIX0ybBhKVfKdBPR1lH4CV8@public.gmane.org>
2016-11-18 12:26       ` Nayna
2016-11-18 15:52     ` Jarkko Sakkinen
2016-11-19 18:22       ` Jason Gunthorpe
2016-11-20  9:46         ` Jarkko Sakkinen
2016-11-20  9:47           ` Jarkko Sakkinen
2016-11-20 12:14         ` Jarkko Sakkinen
     [not found]           ` <20161120121451.awcraondhcvzpbig-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
2016-11-21 17:55             ` Jason Gunthorpe
2016-11-21 20:30               ` Jarkko Sakkinen
     [not found]               ` <20161121175520.GA24191-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org>
2016-11-21 20:32                 ` Jarkko Sakkinen
2016-11-21 20:36                   ` Jarkko Sakkinen
2016-11-21 20:37                   ` Jason Gunthorpe
     [not found]                     ` <20161121203708.GA7294-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org>
2016-11-21 20:46                       ` Jarkko Sakkinen
2016-11-21 20:56                         ` Jason Gunthorpe
2016-11-20 18:36         ` Nayna
2016-11-21 17:15           ` Jason Gunthorpe
2016-11-21 20:29             ` Jarkko Sakkinen
2016-11-22 16:37               ` Jason Gunthorpe
     [not found]                 ` <20161122163720.GB3956-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org>
2016-11-22 16:48                   ` Jarkko Sakkinen
2016-11-22  9:04             ` Nayna
2016-11-18 15:52   ` Jarkko Sakkinen [this message]

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=20161118155200.czodzutm72aqfb77@intel.com \
    --to=jarkko.sakkinen-vuqaysv1563yd54fqh9/ca@public.gmane.org \
    --cc=stefanb-23VcF4HTsmIX0ybBhKVfKdBPR1lH4CV8@public.gmane.org \
    --cc=tpmdd-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.