lkml.org 
[lkml]   [2013]   [Sep]   [20]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: Null pointer deference in drivers/power/pm2301_charger.c
From
Date
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



\
 
 \ /
  Last update: 2013-09-21 05:41    [W:0.045 / U:3.348 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site