Commit f381a435 authored by Andrei Vagin's avatar Andrei Vagin

action-scripts: check a return code of get_service_fd

>>>     CID 190177:  Integer handling issues  (NEGATIVE_RETURNS)
>>>     rpc_sk is passed to a parameter that cannot be negative.
Signed-off-by: 's avatarAndrei Vagin <avagin@virtuozzo.com>
parent 237260f4
...@@ -108,6 +108,8 @@ int rpc_send_fd(enum script_actions act, int fd) ...@@ -108,6 +108,8 @@ int rpc_send_fd(enum script_actions act, int fd)
return -1; return -1;
rpc_sk = get_service_fd(RPC_SK_OFF); rpc_sk = get_service_fd(RPC_SK_OFF);
if (rpc_sk < 0)
return -1;
pr_debug("\tRPC\n"); pr_debug("\tRPC\n");
return send_criu_rpc_script(act, (char *)action, rpc_sk, fd); return send_criu_rpc_script(act, (char *)action, rpc_sk, fd);
...@@ -128,6 +130,10 @@ int run_scripts(enum script_actions act) ...@@ -128,6 +130,10 @@ int run_scripts(enum script_actions act)
pr_debug("\tRPC\n"); pr_debug("\tRPC\n");
rpc_sk = get_service_fd(RPC_SK_OFF); rpc_sk = get_service_fd(RPC_SK_OFF);
if (rpc_sk < 0) {
ret = -1;
goto out;
}
ret = send_criu_rpc_script(act, (char *)action, rpc_sk, -1); ret = send_criu_rpc_script(act, (char *)action, rpc_sk, -1);
goto out; goto out;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment