]> git.baikalelectronics.ru Git - kernel.git/commit
hwmon: (pmbus/ibm-cffps) Prevent writing on_off_config with bad data
authorEddie James <eajames@linux.ibm.com>
Tue, 7 Jan 2020 15:40:40 +0000 (09:40 -0600)
committerGuenter Roeck <linux@roeck-us.net>
Thu, 23 Jan 2020 21:15:10 +0000 (13:15 -0800)
commit4ac2302fa5f051611e00253b0381d2a38a7c1087
tree43ebf331dc34a603177768f2fc54712f64aa4bc3
parent4707052f52db58acce5a7561939298f4cd978ac5
hwmon: (pmbus/ibm-cffps) Prevent writing on_off_config with bad data

If the user write parameters resulted in no bytes being written to the
temporary buffer, then ON_OFF_CONFIG will be written with uninitialized
data. Prevent this by bailing out in this case.

Signed-off-by: Eddie James <eajames@linux.ibm.com>
Link: https://lore.kernel.org/r/1578411640-16929-1-git-send-email-eajames@linux.ibm.com
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
drivers/hwmon/pmbus/ibm-cffps.c