mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Valdis.Kletnieks@vt.edu
To: Rickard Strandqvist <rickard_strandqvist@spectrumdigital.se>
Cc: Jarod Wilson <jarod@wilsonet.com>,
	Mauro Carvalho Chehab <mchehab@osg.samsung.com>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	Aya Mahfouz <mahfouz.saif.elyazal@gmail.com>,
	Gulsah Kose <gulsah.1004@gmail.com>,
	Tuomas Tynkkynen <tuomas.tynkkynen@iki.fi>,
	Martin Kaiser <martin@kaiser.cx>,
	linux-media@vger.kernel.org, devel@driverdev.osuosl.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH] staging: media: lirc: lirc_zilog: Fix for possible null pointer dereference
Date: Thu, 29 Jan 2015 17:12:40 -0500	[thread overview]
Message-ID: <21497.1422569560@turing-police.cc.vt.edu> (raw)
In-Reply-To: Your message of "Thu, 29 Jan 2015 19:48:08 +0100." <1422557288-3617-1-git-send-email-rickard_strandqvist@spectrumdigital.se>

[-- Attachment #1: Type: text/plain, Size: 854 bytes --]

On Thu, 29 Jan 2015 19:48:08 +0100, Rickard Strandqvist said:
> 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(-)

>  	/* 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");

Yes, the dev_err() call is an obvious thinko.

However, I'm not sure whether removing it entirely is right either.  If
there *should* be a struct IR * passed there, maybe some other printk()
should be issued, or even a WARN_ON(!ir), or something?

[-- Attachment #2: Type: application/pgp-signature, Size: 848 bytes --]

  reply	other threads:[~2015-01-29 22:13 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-01-29 18:48 Rickard Strandqvist
2015-01-29 22:12 ` Valdis.Kletnieks [this message]
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

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=21497.1422569560@turing-police.cc.vt.edu \
    --to=valdis.kletnieks@vt.edu \
    --cc=devel@driverdev.osuosl.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=gulsah.1004@gmail.com \
    --cc=jarod@wilsonet.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-media@vger.kernel.org \
    --cc=mahfouz.saif.elyazal@gmail.com \
    --cc=martin@kaiser.cx \
    --cc=mchehab@osg.samsung.com \
    --cc=rickard_strandqvist@spectrumdigital.se \
    --cc=tuomas.tynkkynen@iki.fi \
    /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®