zloop: check for spurious options passed to remove
Zloop uses a command option parser for all control commands,
but most options are only valid for adding a new device. Check
for incorrectly specified options in the remove handler.
Fixes: eb0570c7df ("block: new zoned loop block device driver")
Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Damien Le Moal <dlemoal@kernel.org>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
This commit is contained in:
parent
6acf7860dc
commit
3c4617117a
|
|
@ -1174,7 +1174,12 @@ static int zloop_ctl_remove(struct zloop_options *opts)
|
|||
int ret;
|
||||
|
||||
if (!(opts->mask & ZLOOP_OPT_ID)) {
|
||||
pr_err("No ID specified\n");
|
||||
pr_err("No ID specified for remove\n");
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
if (opts->mask & ~ZLOOP_OPT_ID) {
|
||||
pr_err("Invalid option specified for remove\n");
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue