Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S934242AbcK3Kr7 (ORCPT ); Wed, 30 Nov 2016 05:47:59 -0500 Received: from mail-pg0-f41.google.com ([74.125.83.41]:36826 "EHLO mail-pg0-f41.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756442AbcK3Krt (ORCPT ); Wed, 30 Nov 2016 05:47:49 -0500 Date: Wed, 30 Nov 2016 16:17:45 +0530 From: Viresh Kumar To: Rafael Wysocki , jy0922.shim@samsung.com, Viresh Kumar , Nishanth Menon , Stephen Boyd Cc: linaro-kernel@lists.linaro.org, linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org, Vincent Guittot , "# v4 . 4+" Subject: Re: [PATCH V4] PM / OPP: Pass opp_table to dev_pm_opp_put_regulator() Message-ID: <20161130104745.GM3288@vireshk-i7> References: <480ae6e161788d338fb1637aa2615a75588ac3c6.1480478081.git.viresh.kumar@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <480ae6e161788d338fb1637aa2615a75588ac3c6.1480478081.git.viresh.kumar@linaro.org> User-Agent: Mutt/1.5.24 (2015-08-30) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 686 Lines: 26 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