Thread (17 messages) 17 messages, 3 authors, 2018-06-26

Re: [PATCH V9] powercap/drivers/idle_injection: Add an idle injection framework

From: Viresh Kumar <viresh.kumar@linaro.org>
Date: 2018-06-25 09:44:21
Also in: lkml

On 25-06-18, 10:23, Rafael J. Wysocki wrote:
On Tue, Jun 19, 2018 at 3:23 PM, Daniel Lezcano
quoted
+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
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help