Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

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: eb0570c7df23 ("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>

authored by

Christoph Hellwig and committed by
Jens Axboe
3c461711 6acf7860

+6 -1
+6 -1
drivers/block/zloop.c
··· 1174 1174 int ret; 1175 1175 1176 1176 if (!(opts->mask & ZLOOP_OPT_ID)) { 1177 - pr_err("No ID specified\n"); 1177 + pr_err("No ID specified for remove\n"); 1178 + return -EINVAL; 1179 + } 1180 + 1181 + if (opts->mask & ~ZLOOP_OPT_ID) { 1182 + pr_err("Invalid option specified for remove\n"); 1178 1183 return -EINVAL; 1179 1184 } 1180 1185