Commit 68e58a294fb26f692697179e3f3ecf88dd8cb97c

Authored by Mike Snitzer
Committed by Alasdair G Kergon
1 parent d93dc5c447

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: Zdenek Kabelac <zkabelac@redhat.com>
Signed-off-by: Mike Snitzer <snitzer@redhat.com>
Signed-off-by: Alasdair G Kergon <agk@redhat.com>

Showing 1 changed file with 3 additions and 1 deletions Side-by-side Diff

drivers/md/dm-flakey.c
... ... @@ -81,8 +81,10 @@
81 81 * corrupt_bio_byte <Nth_byte> <direction> <value> <bio_flags>
82 82 */
83 83 if (!strcasecmp(arg_name, "corrupt_bio_byte")) {
84   - if (!argc)
  84 + if (!argc) {
85 85 ti->error = "Feature corrupt_bio_byte requires parameters";
  86 + return -EINVAL;
  87 + }
86 88  
87 89 r = dm_read_arg(_args + 1, as, &fc->corrupt_bio_byte, &ti->error);
88 90 if (r)