From b1ffc1f465928706e22d585932cead8d74f021de Mon Sep 17 00:00:00 2001 From: Phil Sutter Date: Thu, 18 Oct 2018 13:28:23 +0200 Subject: [PATCH] devlink: Fix error reporting in cmd_resource_set() resource_path_parse() returns either zero or a negative error code, hence the negated value must be passed to strerror(). Fixes: 8cd644095842a ("devlink: Add support for devlink resource abstraction") Signed-off-by: Phil Sutter Acked-by: Jiri Pirko Signed-off-by: Stephen Hemminger --- devlink/devlink.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/devlink/devlink.c b/devlink/devlink.c index 519ee257..8bb254ea 100644 --- a/devlink/devlink.c +++ b/devlink/devlink.c @@ -5127,7 +5127,7 @@ static int cmd_resource_set(struct dl *dl) &dl->opts.resource_id, &dl->opts.resource_id_valid); if (err) { - pr_err("error parsing resource path %s\n", strerror(err)); + pr_err("error parsing resource path %s\n", strerror(-err)); goto out; }