]> git.ipfire.org Git - thirdparty/iproute2.git/commitdiff
devlink: Fix error reporting in cmd_resource_set()
authorPhil Sutter <phil@nwl.cc>
Thu, 18 Oct 2018 11:28:23 +0000 (13:28 +0200)
committerStephen Hemminger <stephen@networkplumber.org>
Mon, 22 Oct 2018 17:05:18 +0000 (10:05 -0700)
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 <phil@nwl.cc>
Acked-by: Jiri Pirko <jiri@mellanox.com>
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
devlink/devlink.c

index 519ee2577cc4ccd1493ba787f64b3eea73b45193..8bb254ea1b0b813c7c62991b4e8106fa579e6577 100644 (file)
@@ -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;
        }