summaryrefslogtreecommitdiffstats
path: root/drivers/firmware
diff options
context:
space:
mode:
authorArnd Bergmann <arnd@arndb.de>2018-03-27 15:57:19 +0200
committerArnd Bergmann <arnd@arndb.de>2018-03-27 15:57:19 +0200
commitf8d6dc78b8b994cf6903879ab6abf3cb25b76daf (patch)
tree8a3aa04d6b7873bef12f957648e58b34d268950d /drivers/firmware
parentb701b41bb4f6304e95fffb1c2b2f0bb9158a2245 (diff)
parent7f9badfceffc6d2ae331050f1cd155a633130437 (diff)
downloadlinux-f8d6dc78b8b994cf6903879ab6abf3cb25b76daf.tar.bz2
Merge tag 'scmi-fixes-4.17' of ssh://gitolite.kernel.org/pub/scm/linux/kernel/git/sudeep.holla/linux into next/drivers
Pull "ARM SCMI fixes/cleanups for v4.17" from Sudeep Holla: Couple of fixes for build warning due to uninitialised variable and static checker warning for passing NULL pointer to PTR_ERR. It also contains cleanup suggested by Stephen Boyd in SCMI clock driver using the new devm_of_clk_add_hw_provider() API. * tag 'scmi-fixes-4.17' of ssh://gitolite.kernel.org/pub/scm/linux/kernel/git/sudeep.holla/linux: clk: scmi: use devm_of_clk_add_hw_provider() API and drop scmi_clocks_remove firmware: arm_scmi: prevent accessing rate_discrete uninitialized hwmon: (scmi) return -EINVAL when sensor information is unavailable
Diffstat (limited to 'drivers/firmware')
-rw-r--r--drivers/firmware/arm_scmi/clock.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/drivers/firmware/arm_scmi/clock.c b/drivers/firmware/arm_scmi/clock.c
index e8ffad33a0ff..e6f17825db79 100644
--- a/drivers/firmware/arm_scmi/clock.c
+++ b/drivers/firmware/arm_scmi/clock.c
@@ -125,7 +125,7 @@ scmi_clock_describe_rates_get(const struct scmi_handle *handle, u32 clk_id,
{
u64 *rate;
int ret, cnt;
- bool rate_discrete;
+ bool rate_discrete = false;
u32 tot_rate_cnt = 0, rates_flag;
u16 num_returned, num_remaining;
struct scmi_xfer *t;
@@ -147,7 +147,7 @@ scmi_clock_describe_rates_get(const struct scmi_handle *handle, u32 clk_id,
ret = scmi_do_xfer(handle, t);
if (ret)
- break;
+ goto err;
rates_flag = le32_to_cpu(rlist->num_rates_flags);
num_remaining = NUM_REMAINING(rates_flag);
@@ -185,6 +185,7 @@ scmi_clock_describe_rates_get(const struct scmi_handle *handle, u32 clk_id,
if (rate_discrete)
clk->list.num_rates = tot_rate_cnt;
+err:
scmi_one_xfer_put(handle, t);
return ret;
}