[PATCH RFC 05/38] platform/x86: toshiba_acpi: reject malformed brightness and fan writes

sashiko-bot at kernel.org sashiko-bot at kernel.org
Tue Nov 3 06:47:35 PST 2026


> When lcd_proc_write() and fan_proc_write() were refactored their checks
> were inverted but the && stayed. They only fail if sscanf() didn't
> parse anything and the value is out of range at the same time, and for
> the brightness value < 0 && value > levels can't be true at all. So an
> out of range brightness or fan setting is passed on to the hardware,
> and so is the uninitialized value if nothing could be parsed.
> 
> Restore the checks as they were before the refactoring.
> 
> Fixes: e1a949c1b988 ("toshiba_acpi: Refactor *{get, set} functions return value")
> Fixes: 3e07e5baa2af ("toshiba_acpi: Add set_fan_status function")
> Cc: stable at vger.kernel.org
> Signed-off-by: Christian Brauner (Amutable) <brauner at kernel.org>

Sashiko has reviewed this patch and found no issues.

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20261102-work-procfs-bugfixes-v1-0-59422ed3e465@kernel.org?part=5




More information about the kexec mailing list