From 50a480701f4bf6885d3811e245a47d99661695d8 Mon Sep 17 00:00:00 2001 From: Milind Changire Date: Wed, 22 Nov 2017 17:03:11 +0530 Subject: rpc-lib: coverity fixes Scan URL: https://download.gluster.org/pub/gluster/glusterfs/static-analysis/master/glusterfs-coverity/2017-11-10-0f524f07/html/ ID: 9 (BAD_SHIFT) ID: 58 (CHECKED_RETURN) ID: 98 (DEAD_CODE) ID: 249, 250, 251, 252 (MIXED_ENUMS) ID: 289, 297 (NULL_RETURNS) ID: 609, 613, 622, 644, 653, 655 (UNUSED_VALUE) ID: 432 (RESOURCE_LEAK) Change-Id: I2349877214dd38b789e08b74be05539f09b751b9 BUG: 789278 Signed-off-by: Milind Changire --- rpc/rpc-lib/src/rpc-clnt.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'rpc/rpc-lib/src/rpc-clnt.c') diff --git a/rpc/rpc-lib/src/rpc-clnt.c b/rpc/rpc-lib/src/rpc-clnt.c index 2fc3b38df2c..adb8e3d4a60 100644 --- a/rpc/rpc-lib/src/rpc-clnt.c +++ b/rpc/rpc-lib/src/rpc-clnt.c @@ -946,6 +946,11 @@ rpc_clnt_notify (rpc_transport_t *trans, void *mydata, clnt->mydata = NULL; ret = clnt->notifyfn (clnt, clnt_mydata, RPC_CLNT_DESTROY, NULL); + if (ret < 0) { + gf_log (trans->name, GF_LOG_WARNING, + "client notify handler returned error " + "while handling RPC_CLNT_DESTROY"); + } } rpc_clnt_destroy (clnt); ret = 0; @@ -1667,6 +1672,13 @@ rpc_clnt_submit (struct rpc_clnt *rpc, rpc_clnt_prog_t *prog, if (conn->connected == 0 && !rpc->disabled) { ret = rpc_transport_connect (conn->trans, conn->config.remote_port); + if (ret < 0) { + gf_log (conn->name, GF_LOG_WARNING, + "error returned while attempting to " + "connect to host:%s, port:%d", + conn->config.remote_host, + conn->config.remote_port); + } } ret = rpc_transport_submit_request (conn->trans, &req); -- cgit