diff --git a/tools/pvscan.c b/tools/pvscan.c index e792aab8e..5d0f53f4f 100644 --- a/tools/pvscan.c +++ b/tools/pvscan.c @@ -880,6 +880,11 @@ static int _get_args(struct cmd_context *cmd, int argc, char **argv, continue; } + if ((major < 0) || (minor < 0)) { + log_warn("WARNING: Invalid major:minor %d:%d, skipping.", major, minor); + continue; + } + if (!(arg = dm_pool_zalloc(cmd->mem, sizeof(*arg)))) return_0; arg->devno = MKDEV(major, minor);