Blob Blame History Raw
From 8193c9eaecd5a9a5237424081c109df0d27770fd Mon Sep 17 00:00:00 2001
From: Phil Sutter <psutter@redhat.com>
Date: Thu, 25 Oct 2018 12:24:30 +0200
Subject: [PATCH] devlink: Fix error reporting in cmd_resource_set()

Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=1602555
Upstream Status: iproute2.git commit b1ffc1f465928

commit b1ffc1f465928706e22d585932cead8d74f021de
Author: Phil Sutter <phil@nwl.cc>
Date:   Thu Oct 18 13:28:23 2018 +0200

    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 <phil@nwl.cc>
    Acked-by: Jiri Pirko <jiri@mellanox.com>
    Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
 devlink/devlink.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/devlink/devlink.c b/devlink/devlink.c
index 1142d16..7a5aef8 100644
--- a/devlink/devlink.c
+++ b/devlink/devlink.c
@@ -4457,7 +4457,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;
 	}
 
-- 
1.8.3.1