[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAHuBVBb7B9UPiqZH0Y2MpMkUri02ApRMZfAwCctKG-tYnkbkSQ@mail.gmail.com>
Date: Sat, 21 Sep 2013 04:25:51 +0300
From: Valentin Ilie <eminemix@...il.com>
To: anton@...msg.org, dwmw2@...radead.org, linux-kernel@...r.kernel.org
Subject: Null pointer deference in drivers/power/pm2301_charger.c
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) ?
Thank you,
Valentin
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists