]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/commit
cpufreq: Reorder cpufreq_online() error code path
authorViresh Kumar <viresh.kumar@linaro.org>
Thu, 22 Feb 2018 05:59:43 +0000 (11:29 +0530)
committerKleber Sacilotto de Souza <kleber.souza@canonical.com>
Mon, 27 Aug 2018 14:40:05 +0000 (16:40 +0200)
commit52209d82b984a16f85c806105aae49e4f3dddade
tree722e28f1581c70f605cf3f7b5da209134a18b791
parent994efff66cb7979a6b8634e509b81528343e88fa
cpufreq: Reorder cpufreq_online() error code path

BugLink: http://bugs.launchpad.net/bugs/1786352
[ Upstream commit b24b6478e65f140610ab1ffaadc7bc6bf0be8aad ]

Ideally the de-allocation of resources should happen in the exact
opposite order in which they were allocated. It helps maintain the code
in long term, even if nothing really breaks with incorrect ordering.

That wasn't followed in cpufreq_online() and it has some
inconsistencies.  For example, the symlinks were created from within
the locked region while they are removed only after putting the locks.
Also ->exit() should have been called only after the symlinks are
removed and the lock is dropped, as that was the case when ->init()
was first called.

Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
[ rjw: Subject ]
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Signed-off-by: Sasha Levin <alexander.levin@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
Signed-off-by: Khalid Elmously <khalid.elmously@canonical.com>
drivers/cpufreq/cpufreq.c