Commit 4475e699 authored by Andy Shevchenko's avatar Andy Shevchenko

platform/x86: intel_telemetry_debugfs: Respect error code of kstrtou32_from_user()

kstrtou32_from_user() may return different error codes on certain
circumstances. Respect all possible values.
Signed-off-by: default avatarAndy Shevchenko <andriy.shevchenko@linux.intel.com>
parent cbe35819
...@@ -686,13 +686,14 @@ static ssize_t telem_pss_trc_verb_write(struct file *file, ...@@ -686,13 +686,14 @@ static ssize_t telem_pss_trc_verb_write(struct file *file,
u32 verbosity; u32 verbosity;
int err; int err;
if (kstrtou32_from_user(userbuf, count, 0, &verbosity)) err = kstrtou32_from_user(userbuf, count, 0, &verbosity);
return -EFAULT; if (err)
return err;
err = telemetry_set_trace_verbosity(TELEM_PSS, verbosity); err = telemetry_set_trace_verbosity(TELEM_PSS, verbosity);
if (err) { if (err) {
pr_err("Changing PSS Trace Verbosity Failed. Error %d\n", err); pr_err("Changing PSS Trace Verbosity Failed. Error %d\n", err);
count = err; return err;
} }
return count; return count;
...@@ -733,13 +734,14 @@ static ssize_t telem_ioss_trc_verb_write(struct file *file, ...@@ -733,13 +734,14 @@ static ssize_t telem_ioss_trc_verb_write(struct file *file,
u32 verbosity; u32 verbosity;
int err; int err;
if (kstrtou32_from_user(userbuf, count, 0, &verbosity)) err = kstrtou32_from_user(userbuf, count, 0, &verbosity);
return -EFAULT; if (err)
return err;
err = telemetry_set_trace_verbosity(TELEM_IOSS, verbosity); err = telemetry_set_trace_verbosity(TELEM_IOSS, verbosity);
if (err) { if (err) {
pr_err("Changing IOSS Trace Verbosity Failed. Error %d\n", err); pr_err("Changing IOSS Trace Verbosity Failed. Error %d\n", err);
count = err; return err;
} }
return count; return count;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment