Messages in this thread | | | From | "Rafael J. Wysocki" <> | Date | Mon, 25 Jun 2018 12:00:10 +0200 | Subject | Re: [PATCH V9] powercap/drivers/idle_injection: Add an idle injection framework |
| |
On Mon, Jun 25, 2018 at 11:44 AM, Viresh Kumar <viresh.kumar@linaro.org> wrote: > 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 :)
Well, fair enough.
| |