devlink: Fix error reporting in cmd_resource_set()
Subsystems (2)
PATCH 1/1 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 <[email protected]>
--- devlink/devlink.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
devlink/devlink.c +1 -1
@@ -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; }
Signature · 1 line
2.19.0
Quoted 5 lines · Thu, Oct 18, 2018 at 01:28:23PM CEST, [email protected] wrote:
resource_path_parse()returns either zero or a negative error code, hence the negated value must be passed tostrerror().Fixes 8cd644095842a ("devlink: Add support for devlink resource abstraction")Signed-off-by Phil Sutter <[email protected]>
Acked-by Jiri Pirko <[email protected]>