[PATCH] staging: media: lirc: lirc_zilog: Fix for possible null pointer dereference

Valdis.Kletnieks at vt.edu Valdis.Kletnieks at vt.edu
Fri Jan 30 13:09:24 UTC 2015


On Fri, 30 Jan 2015 16:00:02 +0300, Dan Carpenter said:

> > > -	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?
>
> We set filep->private_data to non-NULL in open() so I don't think it can
> be NULL here.

Then probably the *right* fix is to remove the *entire* if statement, as
we can't end up doing the 'return -ENODEV'....
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 848 bytes
Desc: not available
URL: <http://driverdev.linuxdriverproject.org/pipermail/driverdev-devel/attachments/20150130/497f9320/attachment.asc>


More information about the devel mailing list