diff options
author | Roland Dreier <roland@purestorage.com> | 2012-04-16 14:32:17 -0400 |
---|---|---|
committer | Roland Dreier <roland@purestorage.com> | 2012-05-08 14:17:47 -0400 |
commit | da4964387d997244b043dd812540bed851c45c9e (patch) | |
tree | 54b77bf1acbe9fb628a7ec52c0faa425a299531c /drivers/infiniband/hw/ocrdma/ocrdma_verbs.c | |
parent | fe2caefcdf5869f308c102e3d64d40683bfad711 (diff) |
RDMA/ocrdma: Fix warnings about uninitialized variables
First, fix
drivers/infiniband/hw/ocrdma/ocrdma_verbs.c: In function 'ocrdma_alloc_pd':
drivers/infiniband/hw/ocrdma/ocrdma_verbs.c:371:17: warning: 'dpp_page_addr' may be used uninitialized in this function [-Wuninitialized]
drivers/infiniband/hw/ocrdma/ocrdma_verbs.c:337:6: note: 'dpp_page_addr' was declared here
which seems that it may border on a bug (the call to ocrdma_del_mmap()
might conceivably do bad things if pd->dpp_enabled is not set and
dpp_page_addr ends up with just the wrong value).
Also take care of:
drivers/infiniband/hw/ocrdma/ocrdma_hw.c: In function 'ocrdma_init_hw':
drivers/infiniband/hw/ocrdma/ocrdma_hw.c:2587:5: warning: 'status' may be used uninitialized in this function [-Wuninitialized]
drivers/infiniband/hw/ocrdma/ocrdma_hw.c:2549:17: note: 'status' was declared here
which is only real if num_eq == 0, which should be impossible.
Signed-off-by: Roland Dreier <roland@purestorage.com>
Diffstat (limited to 'drivers/infiniband/hw/ocrdma/ocrdma_verbs.c')
-rw-r--r-- | drivers/infiniband/hw/ocrdma/ocrdma_verbs.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/drivers/infiniband/hw/ocrdma/ocrdma_verbs.c b/drivers/infiniband/hw/ocrdma/ocrdma_verbs.c index 51fc9c7c0acf..e955f1f0848d 100644 --- a/drivers/infiniband/hw/ocrdma/ocrdma_verbs.c +++ b/drivers/infiniband/hw/ocrdma/ocrdma_verbs.c | |||
@@ -334,7 +334,7 @@ static int ocrdma_copy_pd_uresp(struct ocrdma_pd *pd, | |||
334 | { | 334 | { |
335 | int status; | 335 | int status; |
336 | u64 db_page_addr; | 336 | u64 db_page_addr; |
337 | u64 dpp_page_addr; | 337 | u64 dpp_page_addr = 0; |
338 | u32 db_page_size; | 338 | u32 db_page_size; |
339 | struct ocrdma_alloc_pd_uresp rsp; | 339 | struct ocrdma_alloc_pd_uresp rsp; |
340 | struct ocrdma_ucontext *uctx = get_ocrdma_ucontext(ib_ctx); | 340 | struct ocrdma_ucontext *uctx = get_ocrdma_ucontext(ib_ctx); |
@@ -368,7 +368,8 @@ static int ocrdma_copy_pd_uresp(struct ocrdma_pd *pd, | |||
368 | return 0; | 368 | return 0; |
369 | 369 | ||
370 | ucopy_err: | 370 | ucopy_err: |
371 | ocrdma_del_mmap(pd->uctx, dpp_page_addr, OCRDMA_DPP_PAGE_SIZE); | 371 | if (pd->dpp_enabled) |
372 | ocrdma_del_mmap(pd->uctx, dpp_page_addr, OCRDMA_DPP_PAGE_SIZE); | ||
372 | dpp_map_err: | 373 | dpp_map_err: |
373 | ocrdma_del_mmap(pd->uctx, db_page_addr, db_page_size); | 374 | ocrdma_del_mmap(pd->uctx, db_page_addr, db_page_size); |
374 | return status; | 375 | return status; |