Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 68e58a29 authored by Mike Snitzer's avatar Mike Snitzer Committed by Alasdair G Kergon
Browse files

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.

Reported-by: default avatarZdenek Kabelac <zkabelac@redhat.com>
Signed-off-by: default avatarMike Snitzer <snitzer@redhat.com>
Signed-off-by: default avatarAlasdair G Kergon <agk@redhat.com>
parent d93dc5c4
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -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)