arch_topology: validate input frequencies to arch_set_freq_scale()
authorIonela Voinescu <ionela.voinescu@arm.com>
Tue, 1 Sep 2020 20:55:45 +0000 (21:55 +0100)
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>
Fri, 18 Sep 2020 17:10:33 +0000 (19:10 +0200)
commit0a10d3fe3e5c601031676e81b41fb2977650b4d4
tree54822169252c7b96c47ffafeba4f6ea8020ca28e
parent856deb866d16e29bd65952e0289066f6078af773
arch_topology: validate input frequencies to arch_set_freq_scale()

The current frequency passed to arch_set_freq_scale() could end up
being 0, signaling an error in setting a new frequency. Also, if the
maximum frequency in 0, this will result in a division by 0 error.

Therefore, validate these input values before using them for the
setting of the frequency scale factor.

Signed-off-by: Ionela Voinescu <ionela.voinescu@arm.com>
Acked-by: Viresh Kumar <viresh.kumar@linaro.org>
Reviewed-by: Sudeep Holla <sudeep.holla@arm.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
drivers/base/arch_topology.c