提交 dc06dd1f 编写于 作者: S Shiyang Ruan 提交者: Zheng Zengkai

device-dax: Fix default return code of range_parse()

stable inclusion
from stable-5.10.20
commit fc22917f48ee61eebfc462de92a685b9f508bddc
bugzilla: 50608

--------------------------------

[ Upstream commit 7323fb22 ]

The return value of range_parse() indicates the size when it is
positive.  The error code should be negative.
Signed-off-by: NShiyang Ruan <ruansy.fnst@cn.fujitsu.com>
Reviewed-by: NJoao Martins <joao.m.martins@oracle.com>
Link: https://lore.kernel.org/r/20210126021331.1059933-1-ruansy.fnst@cn.fujitsu.comReported-by: NZhang Qilong <zhangqilong3@huawei.com>
Fixes: 8490e2e2 ("device-dax: add a range mapping allocation attribute")
Signed-off-by: NDan Williams <dan.j.williams@intel.com>
Signed-off-by: NSasha Levin <sashal@kernel.org>
Signed-off-by: NChen Jun <chenjun102@huawei.com>
Acked-by: NXie XiuQi <xiexiuqi@huawei.com>
Signed-off-by: NZheng Zengkai <zhengzengkai@huawei.com>
上级 0a32061f
......@@ -1046,7 +1046,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)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册