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:
parent
3c70ae1803
commit
a520b3002c
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user