From: Mika Westerberg Date: Wed, 22 Jan 2020 16:46:18 +0000 (+0300) Subject: platform/x86: intel_pmc_ipc: Propagate error from kstrtoul() X-Git-Tag: v5.6-rc1~199^2~1 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=fc07ac64499702ca217e857e3ef924f30e0506bd;p=thirdparty%2Flinux.git 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 Reviewed-by: Andy Shevchenko Signed-off-by: Andy Shevchenko --- diff --git a/drivers/platform/x86/intel_pmc_ipc.c b/drivers/platform/x86/intel_pmc_ipc.c index b87036089a541..7b180ead064af 100644 --- a/drivers/platform/x86/intel_pmc_ipc.c +++ b/drivers/platform/x86/intel_pmc_ipc.c @@ -512,8 +512,9 @@ static ssize_t intel_pmc_ipc_northpeak_store(struct device *dev, int subcmd; int ret; - if (kstrtoul(buf, 0, &val)) - return -EINVAL; + ret = kstrtoul(buf, 0, &val); + if (ret) + return ret; if (val) subcmd = 1;