From: Phil Sutter Date: Thu, 18 Oct 2018 11:28:23 +0000 (+0200) Subject: devlink: Fix error reporting in cmd_resource_set() X-Git-Tag: v4.19.0~8 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b1ffc1f465928706e22d585932cead8d74f021de;p=thirdparty%2Fiproute2.git 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 --- diff --git a/devlink/devlink.c b/devlink/devlink.c index 519ee2577..8bb254ea1 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; }