Blame SOURCES/5443d71-dax_io-fix-unknown-parameter-handling.patch

4e69d4
dax_io: fix unknown parameter handling
4e69d4
4e69d4
BZ: 
4e69d4
4e69d4
commit 5443d71625ea1082fb987fbce5eddb66c0a1e613
4e69d4
Author: Jeff Moyer <jmoyer@redhat.com>
4e69d4
Date:   Fri Oct 20 11:41:41 2017 -0400
4e69d4
4e69d4
    dax_io: fix unknown parameter handling
4e69d4
    
4e69d4
    The loop will never run more than once, since there's a
4e69d4
    return.  What's more, the following code, which prints out
4e69d4
    the usage statement, also won't run.  Let's change this to
4e69d4
    look more like other commands.  Print out invalid options
4e69d4
    and then print out the usage.  usage_with_options will exit,
4e69d4
    so no need for a return there.
4e69d4
    
4e69d4
    Signed-off-by: Jeff Moyer <jmoyer@redhat.com>
4e69d4
4e69d4
diff --git a/daxctl/io.c b/daxctl/io.c
4e69d4
index 27e7463..2f8cb4a 100644
4e69d4
--- a/daxctl/io.c
4e69d4
+++ b/daxctl/io.c
4e69d4
@@ -526,15 +526,11 @@ int cmd_io(int argc, const char **argv, void *daxctl_ctx)
4e69d4
 	struct ndctl_ctx *ndctl_ctx;
4e69d4
 
4e69d4
 	argc = parse_options(argc, argv, options, u, 0);
4e69d4
-	for (i = 0; i < argc; i++) {
4e69d4
+	for (i = 0; i < argc; i++)
4e69d4
 		fail("Unknown parameter \"%s\"\n", argv[i]);
4e69d4
-		return -EINVAL;
4e69d4
-	}
4e69d4
 
4e69d4
-	if (argc) {
4e69d4
+	if (argc)
4e69d4
 		usage_with_options(u, options);
4e69d4
-		return 0;
4e69d4
-	}
4e69d4
 
4e69d4
 	if (!io.dev[0].parm_path && !io.dev[1].parm_path) {
4e69d4
 		usage_with_options(u, options);