1
0
mirror of git://sourceware.org/git/lvm2.git synced 2025-02-25 21:57:45 +03:00

lvmlockctl: ensure result value is always defined

Ensure passed pointer gets predefined value (instead of random stack
value).
This commit is contained in:
Zdenek Kabelac 2020-02-04 15:33:36 +01:00
parent bcfe4993e5
commit d01f27f411

View File

@ -326,6 +326,8 @@ static int _lvmlockd_result(daemon_reply reply, int *result)
{ {
int reply_result; int reply_result;
*result = NO_LOCKD_RESULT;
if (reply.error) { if (reply.error) {
log_error("lvmlockd_result reply error %d", reply.error); log_error("lvmlockd_result reply error %d", reply.error);
return 0; return 0;
@ -337,7 +339,7 @@ static int _lvmlockd_result(daemon_reply reply, int *result)
} }
reply_result = daemon_reply_int(reply, "op_result", NO_LOCKD_RESULT); reply_result = daemon_reply_int(reply, "op_result", NO_LOCKD_RESULT);
if (reply_result == -1000) { if (reply_result == NO_LOCKD_RESULT) {
log_error("lvmlockd_result no op_result"); log_error("lvmlockd_result no op_result");
return 0; return 0;
} }