Re: [PATCH] PM / OPP: Initialize regulator pointer to an error value

From: Viresh Kumar
Date: Mon Feb 15 2016 - 11:44:26 EST


On 15-02-16, 16:42, Jon Hunter wrote:
>
> On 15/02/16 16:26, Viresh Kumar wrote:
> > We are currently required to do two checks for regulator pointer:
> > IS_ERR() and IS_NULL().
> >
> > And multiple instances are reported, about both of these not being used
> > consistently and so resulting in crashes.
> >
> > Fix that by initializing regulator pointer with an error value and
> > checking it only against an error.
> >
> > This makes code consistent and efficient.
> >
> > Reported-by: Jon Hunter <jonathanh@xxxxxxxxxx>
> > Signed-off-by: Viresh Kumar <viresh.kumar@xxxxxxxxxx>
>
> Tested-by: Jon Hunter <jonathanh@xxxxxxxxxx>

Thanks a lot Jon.

--
viresh