cpufreq: qcom: fix memory leak in error path
authorFabien Parent <fabien.parent@linaro.org>
Sat, 15 Oct 2022 13:04:22 +0000 (15:04 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 29 Oct 2022 08:12:54 +0000 (10:12 +0200)
commitb5606e3ab1f7cc00d89903f4a11fe57747bb3a68
tree7d259920206bd588c9e9f1d25aaf44513a6fc4b7
parentd866f5982c1561e2a07232edac060dcb9c5638ed
cpufreq: qcom: fix memory leak in error path

commit 9f42cf54403a42cb092636804d2628d8ecf71e75 upstream.

If for some reason the speedbin length is incorrect, then there is a
memory leak in the error path because we never free the speedbin buffer.
This commit fixes the error path to always free the speedbin buffer.

Cc: v5.7+ <stable@vger.kernel.org> # v5.7+
Fixes: a8811ec764f9 ("cpufreq: qcom: Add support for krait based socs")
Signed-off-by: Fabien Parent <fabien.parent@linaro.org>
Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/cpufreq/qcom-cpufreq-nvmem.c