summaryrefslogtreecommitdiff
path: root/drivers/hwmon/aspeed-pwm-tacho.c
diff options
context:
space:
mode:
authorJoel Stanley <joel@jms.id.au>2020-08-04 10:58:32 +0300
committerJoel Stanley <joel@jms.id.au>2020-08-04 10:58:36 +0300
commit9524588381df213554a10d3661a9200a4b7f6db2 (patch)
treea4d281b99dcd28b9a1d3077299c26a5671abff88 /drivers/hwmon/aspeed-pwm-tacho.c
parent666e403461fd046b37bc95bba49e82ca6a758bea (diff)
parent67da9e2c2b730b9b788ace749d22d769cf11ee2b (diff)
downloadlinux-dev-5.7.tar.xz
Merge tag 'v5.7.12' into dev-5.7dev-5.7
This is the 5.7.12 stable release Signed-off-by: Joel Stanley <joel@jms.id.au>
Diffstat (limited to 'drivers/hwmon/aspeed-pwm-tacho.c')
-rw-r--r--drivers/hwmon/aspeed-pwm-tacho.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/hwmon/aspeed-pwm-tacho.c b/drivers/hwmon/aspeed-pwm-tacho.c
index 33fb54845bf6..3d8239fd66ed 100644
--- a/drivers/hwmon/aspeed-pwm-tacho.c
+++ b/drivers/hwmon/aspeed-pwm-tacho.c
@@ -851,6 +851,8 @@ static int aspeed_create_fan(struct device *dev,
ret = of_property_read_u32(child, "reg", &pwm_port);
if (ret)
return ret;
+ if (pwm_port >= ARRAY_SIZE(pwm_port_params))
+ return -EINVAL;
aspeed_create_pwm_port(priv, (u8)pwm_port);
ret = of_property_count_u8_elems(child, "cooling-levels");