* mfd: dereferencing first then checking
@ 2010-03-08 12:55 Dan Carpenter
2010-03-19 11:48 ` Samuel Ortiz
0 siblings, 1 reply; 2+ messages in thread
From: Dan Carpenter @ 2010-03-08 12:55 UTC (permalink / raw)
To: kernel-janitors
drivers/mfd/t7l66xb.c +371 t7l66xb_probe(58) warn: variable dereferenced before check 'pdata'
338 t7l66xb->irq_base = pdata->irq_base;
[snip]
371 if (pdata && pdata->enable)
372 pdata->enable(dev);
Can pdata be null here? We dereferenced on line 338 without checking.
regards,
dan carpenter
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: mfd: dereferencing first then checking
2010-03-08 12:55 mfd: dereferencing first then checking Dan Carpenter
@ 2010-03-19 11:48 ` Samuel Ortiz
0 siblings, 0 replies; 2+ messages in thread
From: Samuel Ortiz @ 2010-03-19 11:48 UTC (permalink / raw)
To: kernel-janitors
Hi Dan,
On Mon, Mar 08, 2010 at 03:55:22PM +0300, Dan Carpenter wrote:
> drivers/mfd/t7l66xb.c +371 t7l66xb_probe(58) warn: variable dereferenced before check 'pdata'
> 338 t7l66xb->irq_base = pdata->irq_base;
>
> [snip]
>
> 371 if (pdata && pdata->enable)
> 372 pdata->enable(dev);
>
> Can pdata be null here? We dereferenced on line 338 without checking.
We should definitely check for pdata being not NULL here.
I fixed that, thanks for spotting it.
Cheers,
Samuel.
> regards,
> dan carpenter
--
Intel Open Source Technology Centre
http://oss.intel.com/
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2010-03-19 11:48 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-03-08 12:55 mfd: dereferencing first then checking Dan Carpenter
2010-03-19 11:48 ` Samuel Ortiz
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox