lkml.org 
[lkml]   [2012]   [Jul]   [26]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [RFC PATCH] drivers: regulator: add error checks for exported APIs
On Thu, Jul 26, 2012 at 04:00:03PM +0530, Kishon Vijay Abraham I wrote:

> Added error checks for exported APIs in regulator framework so that
> incorrect use of these APIs does not result in a crash.

The commit (especially the subject) should be more descriptive, it's not
that we're missing error checks it's that you're handling garbage passed
in from the user a bit more gracefully.

I'm not sure how useful this is as-is - if you're not checking your
errors you're not checking your errors so it's probably just pushing the
robustness failures around, especially since...

> + if (IS_ERR_OR_NULL(regulator))
> + return -ENODEV;

...this is too quiet, this should at the very least be generating a loud
warning so people can see there's a problem (probably with WARN_ON so we
can see what called it). Can you respin with something noisier please?

Also NULL is a valid regulator (though we don't use it right now).
[unhandled content-type:application/pgp-signature]
\
 
 \ /
  Last update: 2012-07-26 14:01    [from the cache]
©2003-2014 Jasper Spaans. Advertise on this site