naccyde / rpms / iproute

Forked from rpms/iproute 7 months ago
Clone

Blame SOURCES/0029-devlink-Fix-error-reporting-in-cmd_resource_set.patch

930fb9
From 8193c9eaecd5a9a5237424081c109df0d27770fd Mon Sep 17 00:00:00 2001
930fb9
From: Phil Sutter <psutter@redhat.com>
930fb9
Date: Thu, 25 Oct 2018 12:24:30 +0200
930fb9
Subject: [PATCH] devlink: Fix error reporting in cmd_resource_set()
930fb9
930fb9
Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=1602555
930fb9
Upstream Status: iproute2.git commit b1ffc1f465928
930fb9
930fb9
commit b1ffc1f465928706e22d585932cead8d74f021de
930fb9
Author: Phil Sutter <phil@nwl.cc>
930fb9
Date:   Thu Oct 18 13:28:23 2018 +0200
930fb9
930fb9
    devlink: Fix error reporting in cmd_resource_set()
930fb9
930fb9
    resource_path_parse() returns either zero or a negative error code,
930fb9
    hence the negated value must be passed to strerror().
930fb9
930fb9
    Fixes: 8cd644095842a ("devlink: Add support for devlink resource abstraction")
930fb9
    Signed-off-by: Phil Sutter <phil@nwl.cc>
930fb9
    Acked-by: Jiri Pirko <jiri@mellanox.com>
930fb9
    Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
930fb9
---
930fb9
 devlink/devlink.c | 2 +-
930fb9
 1 file changed, 1 insertion(+), 1 deletion(-)
930fb9
930fb9
diff --git a/devlink/devlink.c b/devlink/devlink.c
930fb9
index 1142d16..7a5aef8 100644
930fb9
--- a/devlink/devlink.c
930fb9
+++ b/devlink/devlink.c
930fb9
@@ -4457,7 +4457,7 @@ static int cmd_resource_set(struct dl *dl)
930fb9
 				  &dl->opts.resource_id,
930fb9
 				  &dl->opts.resource_id_valid);
930fb9
 	if (err) {
930fb9
-		pr_err("error parsing resource path %s\n", strerror(err));
930fb9
+		pr_err("error parsing resource path %s\n", strerror(-err));
930fb9
 		goto out;
930fb9
 	}
930fb9
 
930fb9
-- 
930fb9
1.8.3.1
930fb9