]> git.baikalelectronics.ru Git - kernel.git/commitdiff
device-dax: Fix default return code of range_parse()
authorShiyang Ruan <ruansy.fnst@cn.fujitsu.com>
Tue, 26 Jan 2021 02:13:31 +0000 (10:13 +0800)
committerDan Williams <dan.j.williams@intel.com>
Tue, 16 Feb 2021 22:37:43 +0000 (14:37 -0800)
The return value of range_parse() indicates the size when it is
positive.  The error code should be negative.

Signed-off-by: Shiyang Ruan <ruansy.fnst@cn.fujitsu.com>
Reviewed-by: Joao Martins <joao.m.martins@oracle.com>
Link: https://lore.kernel.org/r/20210126021331.1059933-1-ruansy.fnst@cn.fujitsu.com
Reported-by: Zhang Qilong <zhangqilong3@huawei.com>
Fixes: 8490e2e25b5a ("device-dax: add a range mapping allocation attribute")
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
drivers/dax/bus.c

index 737b207c9e30d73f1378830462104f682d624da4..3003558c1a8bba4c984efe135cc1b09634d27201 100644 (file)
@@ -1038,7 +1038,7 @@ static ssize_t range_parse(const char *opt, size_t len, struct range *range)
 {
        unsigned long long addr = 0;
        char *start, *end, *str;
-       ssize_t rc = EINVAL;
+       ssize_t rc = -EINVAL;
 
        str = kstrdup(opt, GFP_KERNEL);
        if (!str)