Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 3310600a authored by Guenter Roeck's avatar Guenter Roeck
Browse files

hwmon: (f75375s) Fix value range for PWM modes



Accepted value range for PWM modes was 0..4, even though only 0..3 is
subsequently used. Limit permitted value range to 0..3 to avoid unpredictable
behavior.

Cc: Riku Voipio <riku.voipio@iki.fi>
Reviewed-by: default avatarBjoern Gerhart <oss@extracloud.de>
Signed-off-by: default avatarGuenter Roeck <guenter.roeck@ericsson.com>
parent 740f6be3
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -309,7 +309,7 @@ static int set_pwm_enable_direct(struct i2c_client *client, int nr, int val)
	struct f75375_data *data = i2c_get_clientdata(client);
	u8 fanmode;

	if (val < 0 || val > 4)
	if (val < 0 || val > 3)
		return -EINVAL;

	fanmode = f75375_read8(client, F75375_REG_FAN_TIMER);