tpmdd-devel.lists.sourceforge.net archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/2] tpm: Check for parent device being NULL
@ 2016-11-18  0:30 Stefan Berger
       [not found] ` <1479429004-7962-1-git-send-email-stefanb-23VcF4HTsmIX0ybBhKVfKdBPR1lH4CV8@public.gmane.org>
  0 siblings, 1 reply; 22+ messages in thread
From: Stefan Berger @ 2016-11-18  0:30 UTC (permalink / raw)
  To: jarkko.sakkinen-VuQAYsv1563Yd54FQh9/CA,
	tpmdd-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f

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


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

^ permalink raw reply related	[flat|nested] 22+ messages in thread

end of thread, other threads:[~2016-11-22 16:48 UTC | newest]

Thread overview: 22+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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   ` [PATCH 1/2] tpm: Check for parent device being NULL Jarkko Sakkinen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).