Skip to content

Commit fc07ac6

Browse files
westeriandy-shev
authored andcommitted
platform/x86: intel_pmc_ipc: Propagate error from kstrtoul()
kstrtoul() already returns negative error if the input was not valid so return it directly. Signed-off-by: Mika Westerberg <[email protected]> Reviewed-by: Andy Shevchenko <[email protected]> Signed-off-by: Andy Shevchenko <[email protected]>
1 parent 1e3872c commit fc07ac6

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

drivers/platform/x86/intel_pmc_ipc.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -512,8 +512,9 @@ static ssize_t intel_pmc_ipc_northpeak_store(struct device *dev,
512512
int subcmd;
513513
int ret;
514514

515-
if (kstrtoul(buf, 0, &val))
516-
return -EINVAL;
515+
ret = kstrtoul(buf, 0, &val);
516+
if (ret)
517+
return ret;
517518

518519
if (val)
519520
subcmd = 1;

0 commit comments

Comments
 (0)