From: Dan Carpenter <dan.carpenter@oracle.com>
To: Daeseok Youn <daeseok.youn@gmail.com>
Cc: m.chehab@samsung.com, devel@driverdev.osuosl.org,
bernat.ada@gmail.com, gregkh@linuxfoundation.org,
jarod@wilsonet.com, linux-kernel@vger.kernel.org,
paulmck@linux.vnet.ibm.com, mtrompou@gmail.com,
linux-media@vger.kernel.org
Subject: Re: [PATCH] staging: lirc: fix NULL pointer dereference
Date: Wed, 2 Apr 2014 12:13:34 +0300 [thread overview]
Message-ID: <20140402091334.GV6991@mwanda> (raw)
In-Reply-To: <1671118.MbmRfxWPeo@daeseok-laptop.cloud.net>
On Wed, Apr 02, 2014 at 05:18:39PM +0900, Daeseok Youn wrote:
>
> coccicheck says:
> drivers/staging/media/lirc/lirc_igorplugusb.c:226:15-21:
> ERROR: ir is NULL but dereferenced.
>
> Signed-off-by: Daeseok Youn <daeseok.youn@gmail.com>
> ---
> drivers/staging/media/lirc/lirc_igorplugusb.c | 4 ++--
> 1 files changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/staging/media/lirc/lirc_igorplugusb.c b/drivers/staging/media/lirc/lirc_igorplugusb.c
> index f508a13..0ef393b 100644
> --- a/drivers/staging/media/lirc/lirc_igorplugusb.c
> +++ b/drivers/staging/media/lirc/lirc_igorplugusb.c
> @@ -223,8 +223,8 @@ static int unregister_from_lirc(struct igorplug *ir)
> int devnum;
>
> if (!ir) {
> - dev_err(&ir->usbdev->dev,
> - "%s: called with NULL device struct!\n", __func__);
> + printk(DRIVER_NAME "%s: called with NULL device struct!\n",
> + __func__);
It should be pr_err() or something. But actually "ir" can't be NULL so
just delete the whole condition.
> return -EINVAL;
> }
regards,
dan carpenter
next prev parent reply other threads:[~2014-04-02 9:13 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-04-02 8:18 [PATCH] staging: lirc: fix NULL pointer dereference Daeseok Youn
2014-04-02 9:13 ` Dan Carpenter [this message]
2014-04-02 9:41 ` DaeSeok Youn
2014-04-02 9:50 ` DaeSeok Youn
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=20140402091334.GV6991@mwanda \
--to=dan.carpenter@oracle.com \
--cc=bernat.ada@gmail.com \
--cc=daeseok.youn@gmail.com \
--cc=devel@driverdev.osuosl.org \
--cc=gregkh@linuxfoundation.org \
--cc=jarod@wilsonet.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-media@vger.kernel.org \
--cc=m.chehab@samsung.com \
--cc=mtrompou@gmail.com \
--cc=paulmck@linux.vnet.ibm.com \
/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