[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <21497.1422569560@turing-police.cc.vt.edu>
Date: Thu, 29 Jan 2015 17:12:40 -0500
From: Valdis.Kletnieks@...edu
To: Rickard Strandqvist <rickard_strandqvist@...ctrumdigital.se>
Cc: Jarod Wilson <jarod@...sonet.com>,
Mauro Carvalho Chehab <mchehab@....samsung.com>,
Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
Aya Mahfouz <mahfouz.saif.elyazal@...il.com>,
Gulsah Kose <gulsah.1004@...il.com>,
Tuomas Tynkkynen <tuomas.tynkkynen@....fi>,
Martin Kaiser <martin@...ser.cx>, linux-media@...r.kernel.org,
devel@...verdev.osuosl.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] staging: media: lirc: lirc_zilog: Fix for possible null pointer dereference
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@...ctrumdigital.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?
Content of type "application/pgp-signature" skipped
Powered by blists - more mailing lists