Thread (776 messages) 776 messages, 1 author, 2021-03-02
STALE1928d REVIEWED: 1 (0M)

[PATCH 5.11 520/775] device-dax: Fix default return code of range_parse()

From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Date: 2021-03-02 05:53:34
Also in: lkml
Subsystem: device direct access (dax), the rest · Maintainers: Dan Williams, Vishal Verma, Dave Jiang, Linus Torvalds

From: Shiyang Ruan <redacted>

[ Upstream commit 7323fb22f05ff1d20498d267828870a5fbbaebd6 ]

The return value of range_parse() indicates the size when it is
positive.  The error code should be negative.

Signed-off-by: Shiyang Ruan <redacted>
Reviewed-by: Joao Martins <redacted>
Link: https://lore.kernel.org/r/20210126021331.1059933-1-ruansy.fnst@cn.fujitsu.com (local)
Reported-by: Zhang Qilong <redacted>
Fixes: 8490e2e25b5a ("device-dax: add a range mapping allocation attribute")
Signed-off-by: Dan Williams <redacted>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 drivers/dax/bus.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/dax/bus.c b/drivers/dax/bus.c
index 737b207c9e30d..3003558c1a8bb 100644
--- a/drivers/dax/bus.c
+++ b/drivers/dax/bus.c
@@ -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)
-- 
2.27.0


Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help