projects
/
platform
/
kernel
/
linux-rpi.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
3929237
)
hwmon: (pmbus/ibm-cffps) Prevent writing on_off_config with bad data
author
Eddie James
<eajames@linux.ibm.com>
Tue, 7 Jan 2020 15:40:40 +0000
(09:40 -0600)
committer
Guenter Roeck
<linux@roeck-us.net>
Thu, 23 Jan 2020 21:15:10 +0000
(13:15 -0800)
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
patch
|
blob
|
history
diff --git
a/drivers/hwmon/pmbus/ibm-cffps.c
b/drivers/hwmon/pmbus/ibm-cffps.c
index
1c91ee1
..
3795fe5
100644
(file)
--- a/
drivers/hwmon/pmbus/ibm-cffps.c
+++ b/
drivers/hwmon/pmbus/ibm-cffps.c
@@
-250,7
+250,7
@@
static ssize_t ibm_cffps_debugfs_write(struct file *file,
pmbus_set_page(psu->client, 0);
rc = simple_write_to_buffer(&data, 1, ppos, buf, count);
- if (rc < 0)
+ if (rc <
=
0)
return rc;
rc = i2c_smbus_write_byte_data(psu->client,