• Roland Dreier's avatar
    RDMA/ocrdma: Fix warnings about uninitialized variables · da496438
    Roland Dreier authored
    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: default avatarRoland Dreier <roland@purestorage.com>
    da496438
ocrdma_hw.c 72.9 KB