i40iw: Set maj_err and min_err in i40iw_sc_cqp_create
authorShiraz Saleem <shiraz.saleem@intel.com>
Wed, 18 Jan 2017 17:48:29 +0000 (11:48 -0600)
committerDoug Ledford <dledford@redhat.com>
Tue, 24 Jan 2017 21:20:37 +0000 (16:20 -0500)
Set maj_err and min_err in i40iw_sc_cqp_create so that it
returns correct values for all return cases. This also
addresses an uninitialized variable warning for maj_err and
min_err in i40iw_create_cqp.

Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Reported-by: Yuval Shaia <yuval.shaia@oracle.com>
Signed-off-by: Shiraz Saleem <shiraz.saleem@intel.com>
Reviewed-by: Yuval Shaia <yuval.shaia@oracle.com>
Signed-off-by: Doug Ledford <dledford@redhat.com>
drivers/infiniband/hw/i40iw/i40iw_ctrl.c

index ed84584a97b717284024a93cf42a78438d73a151..f82483b3d1e7dc205fa2f6a5e8037fd4d6866eab 100644 (file)
@@ -450,6 +450,9 @@ static enum i40iw_status_code i40iw_sc_cqp_create(struct i40iw_sc_cqp *cqp,
        u32 cnt = 0, p1, p2, val = 0, err_code;
        enum i40iw_status_code ret_code;
 
+       *maj_err = 0;
+       *min_err = 0;
+
        ret_code = i40iw_allocate_dma_mem(cqp->dev->hw,
                                          &cqp->sdbuf,
                                          128,