cpufreq: kryo: Fix possible error code dereference
authorIlia Lin <ilia.lin@gmail.com>
Sun, 17 Jun 2018 19:58:42 +0000 (21:58 +0200)
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>
Tue, 19 Jun 2018 08:35:59 +0000 (10:35 +0200)
commitee3dbcf963c17775417d2fdf74e60f0c1b563dda
tree369c3cf01992985d9e6d114fa13ef26f9691de6f
parentce397d215ccd07b8ae3f71db689aedb85d56ab40
cpufreq: kryo: Fix possible error code dereference

In event of error returned by the nvmem_cell_read() non-pointer value
may be dereferenced. Fix this with error handling.
Additionally free the allocated speedbin buffer, as per the API.

Fixes: 9ce36edd1a52 (cpufreq: Add Kryo CPU scaling driver)
Signed-off-by: Ilia Lin <ilia.lin@gmail.com>
Acked-by: Viresh Kumar <viresh.kumar@linaro.org>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
drivers/cpufreq/qcom-cpufreq-kryo.c