public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] staging: fix possible use-before-NULL-check crash
@ 2010-10-06 22:39 Kees Cook
  2010-10-06 22:51 ` Greg KH
  0 siblings, 1 reply; 3+ messages in thread
From: Kees Cook @ 2010-10-06 22:39 UTC (permalink / raw)
  To: linux-kernel
  Cc: devel, Greg Kroah-Hartman, Mauro Carvalho Chehab, Stefan Ringel,
	Stephen Rothwell

Found via http://coccinelle.lip6.fr/rules/mini_null_ref.cocci

Signed-off-by: Kees Cook <kees.cook@canonical.com>
---
 drivers/staging/tm6000/tm6000-alsa.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/drivers/staging/tm6000/tm6000-alsa.c b/drivers/staging/tm6000/tm6000-alsa.c
index 087137d..c1aff0e 100644
--- a/drivers/staging/tm6000/tm6000-alsa.c
+++ b/drivers/staging/tm6000/tm6000-alsa.c
@@ -426,10 +426,11 @@ error:
 
 static int tm6000_audio_fini(struct tm6000_core *dev)
 {
-	struct snd_tm6000_card	*chip = dev->adev;
+	struct snd_tm6000_card	*chip;
 
 	if (!dev)
 		return 0;
+	chip = dev->adev;
 
 	if (!chip)
 		return 0;
-- 
1.7.1


-- 
Kees Cook
Ubuntu Security Team

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

end of thread, other threads:[~2010-10-07  0:13 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-10-06 22:39 [PATCH] staging: fix possible use-before-NULL-check crash Kees Cook
2010-10-06 22:51 ` Greg KH
2010-10-07  0:12   ` Kees Cook

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox