lkml.org 
[lkml]   [2018]   [Jun]   [25]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH V9] powercap/drivers/idle_injection: Add an idle injection framework
On 25-06-18, 10:23, Rafael J. Wysocki wrote:
> On Tue, Jun 19, 2018 at 3:23 PM, Daniel Lezcano
> > +void idle_injection_get_duration(struct idle_injection_device *ii_dev,
> > + unsigned int *run_duration_ms,
> > + unsigned int *idle_duration_ms)
> > +{
> > + *run_duration_ms = READ_ONCE(ii_dev->run_duration_ms);
> > + *idle_duration_ms = READ_ONCE(ii_dev->idle_duration_ms);
>
> Should you check the arguments against NULL before attempting to
> dereference them? If not, then why not?

I would vote with a NO. This is a mandatory parameter and not filling it in with
a valid pointer is a BUG really. I don't see a reason why we should prevent the
kernel from crashing if such a mistake happens :)

--
viresh

\
 
 \ /
  Last update: 2018-06-25 11:45    [W:2.146 / U:0.004 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site