Re: [PATCH V4] PM / OPP: Pass opp_table to dev_pm_opp_put_regulator()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 30-11-16, 09:29, Viresh Kumar wrote:
> +struct opp_table *dev_pm_opp_set_regulator(struct device *dev, const char *name)
>  {
>  	struct opp_table *opp_table;
>  	struct regulator *reg;
> -	int ret;
>  
>  	mutex_lock(&opp_table_lock);
>  
>  	opp_table = _add_opp_table(dev);
>  	if (!opp_table) {
> -		ret = -ENOMEM;
> +		opp_table = ERR_PTR(-ENOMEM);
>  		goto unlock;
>  	}
>  
>  	/* This should be called before OPPs are initialized */
>  	if (WARN_ON(!list_empty(&opp_table->opp_list))) {
> -		ret = -EBUSY;
> +		opp_table = ERR_PTR(-EBUSY);

The pointer opp_table shouldn't be overwritten here as it will be used
in the error path. Will resend the patch shortly.

-- 
viresh
--
To unsubscribe from this list: send the line "unsubscribe stable" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Linux Kernel]     [Kernel Development Newbies]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite Hiking]     [Linux Kernel]     [Linux SCSI]