public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] staging: media: lirc: lirc_zilog: Fix for possible null pointer dereference
@ 2015-01-29 18:48 Rickard Strandqvist
  2015-01-29 22:12 ` Valdis.Kletnieks
  0 siblings, 1 reply; 6+ messages in thread
From: Rickard Strandqvist @ 2015-01-29 18:48 UTC (permalink / raw)
  To: Jarod Wilson, Mauro Carvalho Chehab
  Cc: Rickard Strandqvist, Greg Kroah-Hartman, Aya Mahfouz, Gulsah Kose,
	Tuomas Tynkkynen, Martin Kaiser, linux-media, devel, linux-kernel

Fix a possible null pointer dereference, there is
otherwise a risk of a possible null pointer dereference.

This was found using a static code analysis program called cppcheck

Signed-off-by: Rickard Strandqvist <rickard_strandqvist@spectrumdigital.se>
---
 drivers/staging/media/lirc/lirc_zilog.c |    4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/drivers/staging/media/lirc/lirc_zilog.c b/drivers/staging/media/lirc/lirc_zilog.c
index cc872fb..78ce3b0 100644
--- a/drivers/staging/media/lirc/lirc_zilog.c
+++ b/drivers/staging/media/lirc/lirc_zilog.c
@@ -1332,10 +1332,8 @@ static int close(struct inode *node, struct file *filep)
 	/* find our IR struct */
 	struct IR *ir = filep->private_data;
 
-	if (ir == NULL) {
-		dev_err(ir->l.dev, "close: no private_data attached to the file!\n");
+	if (ir == NULL)
 		return -ENODEV;
-	}
 
 	atomic_dec(&ir->open_count);
 
-- 
1.7.10.4


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

end of thread, other threads:[~2015-01-31  0:34 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-01-29 18:48 [PATCH] staging: media: lirc: lirc_zilog: Fix for possible null pointer dereference Rickard Strandqvist
2015-01-29 22:12 ` Valdis.Kletnieks
2015-01-30 13:00   ` Dan Carpenter
2015-01-30 13:09     ` Valdis.Kletnieks
2015-01-30 17:06       ` Rickard Strandqvist
2015-01-31  0:01       ` Andy Walls

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