From: Mike Galbraith <bitbucket@online.de>
To: Valentin Ilie <eminemix@gmail.com>
Cc: anton@enomsg.org, dwmw2@infradead.org, linux-kernel@vger.kernel.org
Subject: Re: Null pointer deference in drivers/power/pm2301_charger.c
Date: Sat, 21 Sep 2013 05:20:40 +0200 [thread overview]
Message-ID: <1379733640.5488.3.camel@marge.simpson.net> (raw)
In-Reply-To: <CAHuBVBb7B9UPiqZH0Y2MpMkUri02ApRMZfAwCctKG-tYnkbkSQ@mail.gmail.com>
On Sat, 2013-09-21 at 04:25 +0300, Valentin Ilie wrote:
> Hello,
>
> I am trying to solve a NULL pointer deference in
> drivers/power/pm2301_charger.c (and to submit a trivial patch) but I
> am not sure how to do it.
>
> Line 958 - 961
> pm2 = (struct pm2xxx_charger*)i2c_get_clientdata(pm2xxx_i2c_client);
> if (!pm2) {
> dev_err(pm2->dev, "no pm2xxx_charger data supplied\n");
>
> Line 976 - 978
> pm2 = (struct pm2xxx_charger*)i2c_get_clientdata(pm2xxx_i2c_client);
> if (!pm2) {
> dev_err(pm2->dev, "no pm2xxx_charger data supplied\n");
>
> As it can be clearly seen, pm2 is used with NULL value in dev_err. The
> question is, how to fix this? Should I delete the dev_err line or can
> I use printk (to avoid the need of a dev) ?
Looking below that, seems they perhaps meant &pm2xxx_i2c_client->dev.
-Mike
prev parent reply other threads:[~2013-09-21 3:21 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-09-21 1:25 Valentin Ilie
2013-09-21 3:20 ` Mike Galbraith [this message]
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=1379733640.5488.3.camel@marge.simpson.net \
--to=bitbucket@online.de \
--cc=anton@enomsg.org \
--cc=dwmw2@infradead.org \
--cc=eminemix@gmail.com \
--cc=linux-kernel@vger.kernel.org \
/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®