Skip to contentSkip to conversation

dm flakey: fix corrupt_bio_byte error path

PATCH New Mike Snitzer 1 participant 1 message Aug 4, 2011 Device mapper

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 dm flakey: fix corrupt_bio_byte error path

If no arguments were provided to the corrupt_bio_byte feature an error should be returned immediately.

---
 drivers/md/dm-flakey.c |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)
drivers/md/dm-flakey.c +3 -1
index 89f73ca..f84c080 100644
@@ -81,8 +81,10 @@ static int parse_features(struct dm_arg_set *as, struct flakey_c *fc,
 		 * corrupt_bio_byte <Nth_byte> <direction> <value> <bio_flags>
 		 */
 		if (!strcasecmp(arg_name, "corrupt_bio_byte")) {
-			if (!argc)
+			if (!argc) {
 				ti->error = "Feature corrupt_bio_byte requires parameters";
+				return -EINVAL;
+			}
 
 			r = dm_read_arg(_args + 1, as, &fc->corrupt_bio_byte, &ti->error);
 			if (r)
Signature · 1 line
1.7.4.4