Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

use kstrtol_from_user in dni_dps460 driver #151

Merged
merged 1 commit into from
Jul 10, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 31 additions & 0 deletions patch/driver-hwmon-pmbus-dni_dps460-use-kstrtol-from-user.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
use kstrtol_from_user to convert user data

From: Guohan Lu <[email protected]>


---
drivers/hwmon/pmbus/dni_dps460.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/hwmon/pmbus/dni_dps460.c b/drivers/hwmon/pmbus/dni_dps460.c
index 9d684ea5c..893864652 100644
--- a/drivers/hwmon/pmbus/dni_dps460.c
+++ b/drivers/hwmon/pmbus/dni_dps460.c
@@ -118,7 +118,7 @@ static ssize_t set_target(struct device *dev, struct device_attribute *devattr,
unsigned long val;
unsigned long rpm;

- err = kstrtol(buf, 10, &rpm);
+ err = kstrtol_from_user(buf, count, 10, &rpm);
if (err)
return err;

@@ -150,7 +150,7 @@ static ssize_t set_pec(struct device *dev, struct device_attribute *dummy,
long val;
int err;

- err = kstrtol(buf, 10, &val);
+ err = kstrtol_from_user(buf, count, 10, &val);
if (err < 0)
return err;

1 change: 1 addition & 0 deletions patch/series
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ driver-hwmon-max6620-update.patch
driver-hwmon-max6658-fix-write-convrate.patch
driver-hwmon-pmbus-dni_dps460.patch
driver-hwmon-pmbus-dni_dps460-update-pmbus-core.patch
driver-hwmon-pmbus-dni_dps460-use-kstrtol-from-user.patch
driver-hwmon-pmbus-dps1900.patch
driver-support-tun-config-carrier-enable.patch
driver-support-optoe.patch
Expand Down