mirror of https://gitee.com/openkylin/linux.git
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: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
This commit is contained in:
parent
cbe358191f
commit
4475e69927
|
@ -686,13 +686,14 @@ static ssize_t telem_pss_trc_verb_write(struct file *file,
|
|||
u32 verbosity;
|
||||
int err;
|
||||
|
||||
if (kstrtou32_from_user(userbuf, count, 0, &verbosity))
|
||||
return -EFAULT;
|
||||
err = kstrtou32_from_user(userbuf, count, 0, &verbosity);
|
||||
if (err)
|
||||
return err;
|
||||
|
||||
err = telemetry_set_trace_verbosity(TELEM_PSS, verbosity);
|
||||
if (err) {
|
||||
pr_err("Changing PSS Trace Verbosity Failed. Error %d\n", err);
|
||||
count = err;
|
||||
return err;
|
||||
}
|
||||
|
||||
return count;
|
||||
|
@ -733,13 +734,14 @@ static ssize_t telem_ioss_trc_verb_write(struct file *file,
|
|||
u32 verbosity;
|
||||
int err;
|
||||
|
||||
if (kstrtou32_from_user(userbuf, count, 0, &verbosity))
|
||||
return -EFAULT;
|
||||
err = kstrtou32_from_user(userbuf, count, 0, &verbosity);
|
||||
if (err)
|
||||
return err;
|
||||
|
||||
err = telemetry_set_trace_verbosity(TELEM_IOSS, verbosity);
|
||||
if (err) {
|
||||
pr_err("Changing IOSS Trace Verbosity Failed. Error %d\n", err);
|
||||
count = err;
|
||||
return err;
|
||||
}
|
||||
|
||||
return count;
|
||||
|
|
Loading…
Reference in New Issue