Skip to content

Commit

Permalink
dlm: fix uninitialized variable for search_rsb_list callers
Browse files Browse the repository at this point in the history
gcc 4.3.0 correctly emits the following warning.
search_rsb_list does not *r_ret if no dlm_rsb is found
and _search_rsb may pass the uninitialized value upstream
on the error path when both calls to search_rsb_list
return non-zero error.

The fix sets *r_ret to NULL on search_rsb_list's not-found path.

Signed-off-by: Benny Halevy <bhalevy@panasas.com>
Signed-off-by: David Teigland <teigland@redhat.com>
  • Loading branch information
Benny Halevy authored and David Teigland committed Jul 14, 2008
1 parent 311f6fc commit 18c60c0
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions fs/dlm/lock.c
Original file line number Diff line number Diff line change
Expand Up @@ -363,6 +363,7 @@ static int search_rsb_list(struct list_head *head, char *name, int len,
if (len == r->res_length && !memcmp(name, r->res_name, len))
goto found;
}
*r_ret = NULL;
return -EBADR;

found:
Expand Down

0 comments on commit 18c60c0

Please sign in to comment.