diff options
author | ShyamsundarR <srangana@redhat.com> | 2018-12-12 16:45:09 -0500 |
---|---|---|
committer | Amar Tumballi <amarts@redhat.com> | 2018-12-14 04:33:15 +0000 |
commit | bfe2b5e1530efd364af7a175c8a1c89bc4cab0bb (patch) | |
tree | 2030f52c92661f8d285c9905481787dced506a91 /rpc | |
parent | 8293d21280fd6ddfc9bb54068cf87794fc6be207 (diff) |
clang: Fix various missing checks for empty list
When using list_for_each_entry(_safe) functions, care needs
to be taken that the list passed in are not empty, as these
functions are not empty list safe.
clag scan reported various points where this this pattern
could be caught, and this patch fixes the same.
Additionally the following changes are present in this patch,
- Added an explicit op_ret setting in error case in the
macro MAKE_INODE_HANDLE to address another clang issue reported
- Minor refactoring of some functions in quota code, to address
possible allocation failures in certain functions (which in turn
cause possible empty lists to be passed around)
Change-Id: I1e761a8d218708f714effb56fa643df2a3ea2cc7
Updates: bz#1622665
Signed-off-by: ShyamsundarR <srangana@redhat.com>
Diffstat (limited to 'rpc')
-rw-r--r-- | rpc/rpc-lib/src/rpcsvc.c | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/rpc/rpc-lib/src/rpcsvc.c b/rpc/rpc-lib/src/rpcsvc.c index 0a80bb179c2..273443d5619 100644 --- a/rpc/rpc-lib/src/rpcsvc.c +++ b/rpc/rpc-lib/src/rpcsvc.c @@ -2176,9 +2176,7 @@ rpcsvc_request_handler(void *arg) rpcsvc_actor_t *actor = NULL; gf_boolean_t done = _gf_false; int ret = 0; - struct list_head tmp_list = { - 0, - }; + struct list_head tmp_list; queue = arg; program = queue->program; |