* [iproute PATCH] devlink: Fix error reporting in cmd_resource_set()
@ 2018-10-18 11:28 Phil Sutter
2018-10-18 12:56 ` Jiri Pirko
0 siblings, 1 reply; 2+ messages in thread
From: Phil Sutter @ 2018-10-18 11:28 UTC (permalink / raw)
To: Stephen Hemminger; +Cc: netdev
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>
---
devlink/devlink.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/devlink/devlink.c b/devlink/devlink.c
index 519ee2577cc4c..8bb254ea1b0b8 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;
}
--
2.19.0
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [iproute PATCH] devlink: Fix error reporting in cmd_resource_set()
2018-10-18 11:28 [iproute PATCH] devlink: Fix error reporting in cmd_resource_set() Phil Sutter
@ 2018-10-18 12:56 ` Jiri Pirko
0 siblings, 0 replies; 2+ messages in thread
From: Jiri Pirko @ 2018-10-18 12:56 UTC (permalink / raw)
To: Phil Sutter; +Cc: Stephen Hemminger, netdev
Thu, Oct 18, 2018 at 01:28:23PM CEST, phil@nwl.cc wrote:
>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>
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2018-10-18 21:03 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-10-18 11:28 [iproute PATCH] devlink: Fix error reporting in cmd_resource_set() Phil Sutter
2018-10-18 12:56 ` Jiri Pirko
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).