1
0
mirror of git://sourceware.org/git/lvm2.git synced 2025-01-02 01:18:26 +03:00

locking: validate locking mode

Ensure 'ret' is always defined and validate 'mode'.
This commit is contained in:
Zdenek Kabelac 2019-05-03 13:01:02 +02:00
parent 3c70ae1803
commit a520b3002c

View File

@ -361,6 +361,9 @@ static int _lockf_global(struct cmd_context *cmd, const char *mode, int convert)
} else if (!strcmp(mode, "un")) {
ret = lock_vol(cmd, VG_GLOBAL, LCK_UNLOCK, NULL);
cmd->lockf_global_ex = 0;
} else {
log_error(INTERNAL_ERROR "Unknown locking mode %s.", mode);
return 0;
}
return ret;