2015-05-21 20:00:32

by Laurent Navet

[permalink] [raw]
Subject: [PATCH] RDMA/ocrdma: remove unneeded tests

The same code is executed regardless status value, so these tests can
be removed.
Fix Coverity CID 1271151 and 1268788

Signed-off-by: Laurent Navet <[email protected]>
---
drivers/infiniband/hw/ocrdma/ocrdma_hw.c | 6 ------
1 file changed, 6 deletions(-)

diff --git a/drivers/infiniband/hw/ocrdma/ocrdma_hw.c b/drivers/infiniband/hw/ocrdma/ocrdma_hw.c
index 0c9e959..e748090 100644
--- a/drivers/infiniband/hw/ocrdma/ocrdma_hw.c
+++ b/drivers/infiniband/hw/ocrdma/ocrdma_hw.c
@@ -1960,9 +1960,6 @@ static int ocrdma_mbx_reg_mr_cont(struct ocrdma_dev *dev,
upper_32_bits(hwmr->pbl_table[i + pbl_offset].pa);
}
status = ocrdma_mbx_cmd(dev, (struct ocrdma_mqe *)cmd);
- if (status)
- goto mbx_err;
-mbx_err:
kfree(cmd);
return status;
}
@@ -3044,9 +3041,6 @@ static int ocrdma_mbx_modify_eqd(struct ocrdma_dev *dev, struct ocrdma_eq *eq,
(eq[i].aic_obj.prev_eqd * 65)/100;
}
status = ocrdma_mbx_cmd(dev, (struct ocrdma_mqe *)cmd);
- if (status)
- goto mbx_err;
-mbx_err:
kfree(cmd);
return status;
}
--
2.1.4


2015-05-26 13:10:05

by Doug Ledford

[permalink] [raw]
Subject: Re: [PATCH] RDMA/ocrdma: remove unneeded tests

On Thu, 2015-05-21 at 22:07 +0200, Laurent Navet wrote:
> The same code is executed regardless status value, so these tests can
> be removed.
> Fix Coverity CID 1271151 and 1268788

Thanks, applied for 4.2.

> Signed-off-by: Laurent Navet <[email protected]>
> ---
> drivers/infiniband/hw/ocrdma/ocrdma_hw.c | 6 ------
> 1 file changed, 6 deletions(-)
>
> diff --git a/drivers/infiniband/hw/ocrdma/ocrdma_hw.c b/drivers/infiniband/hw/ocrdma/ocrdma_hw.c
> index 0c9e959..e748090 100644
> --- a/drivers/infiniband/hw/ocrdma/ocrdma_hw.c
> +++ b/drivers/infiniband/hw/ocrdma/ocrdma_hw.c
> @@ -1960,9 +1960,6 @@ static int ocrdma_mbx_reg_mr_cont(struct ocrdma_dev *dev,
> upper_32_bits(hwmr->pbl_table[i + pbl_offset].pa);
> }
> status = ocrdma_mbx_cmd(dev, (struct ocrdma_mqe *)cmd);
> - if (status)
> - goto mbx_err;
> -mbx_err:
> kfree(cmd);
> return status;
> }
> @@ -3044,9 +3041,6 @@ static int ocrdma_mbx_modify_eqd(struct ocrdma_dev *dev, struct ocrdma_eq *eq,
> (eq[i].aic_obj.prev_eqd * 65)/100;
> }
> status = ocrdma_mbx_cmd(dev, (struct ocrdma_mqe *)cmd);
> - if (status)
> - goto mbx_err;
> -mbx_err:
> kfree(cmd);
> return status;
> }


--
Doug Ledford <[email protected]>
GPG KeyID: 0E572FDD


Attachments:
signature.asc (819.00 B)
This is a digitally signed message part

2015-05-26 16:00:13

by Devesh Sharma

[permalink] [raw]
Subject: RE: [PATCH] RDMA/ocrdma: remove unneeded tests

Although already applied, Thanks Laurent and Doug.

Acked-By: Devesh Sharma <[email protected]>

> -----Original Message-----
> From: Doug Ledford [mailto:[email protected]]
> Sent: Tuesday, May 26, 2015 6:15 PM
> To: Laurent Navet
> Cc: [email protected]; [email protected];
> [email protected]; [email protected]; [email protected];
> [email protected]; [email protected]
> Subject: Re: [PATCH] RDMA/ocrdma: remove unneeded tests
>
> On Thu, 2015-05-21 at 22:07 +0200, Laurent Navet wrote:
> > The same code is executed regardless status value, so these tests can
> > be removed.
> > Fix Coverity CID 1271151 and 1268788
>
> Thanks, applied for 4.2.
>
> > Signed-off-by: Laurent Navet <[email protected]>
> > ---
> > drivers/infiniband/hw/ocrdma/ocrdma_hw.c | 6 ------
> > 1 file changed, 6 deletions(-)
> >
> > diff --git a/drivers/infiniband/hw/ocrdma/ocrdma_hw.c
> > b/drivers/infiniband/hw/ocrdma/ocrdma_hw.c
> > index 0c9e959..e748090 100644
> > --- a/drivers/infiniband/hw/ocrdma/ocrdma_hw.c
> > +++ b/drivers/infiniband/hw/ocrdma/ocrdma_hw.c
> > @@ -1960,9 +1960,6 @@ static int ocrdma_mbx_reg_mr_cont(struct
> ocrdma_dev *dev,
> > upper_32_bits(hwmr->pbl_table[i + pbl_offset].pa);
> > }
> > status = ocrdma_mbx_cmd(dev, (struct ocrdma_mqe *)cmd);
> > - if (status)
> > - goto mbx_err;
> > -mbx_err:
> > kfree(cmd);
> > return status;
> > }
> > @@ -3044,9 +3041,6 @@ static int ocrdma_mbx_modify_eqd(struct
> ocrdma_dev *dev, struct ocrdma_eq *eq,
> > (eq[i].aic_obj.prev_eqd * 65)/100;
> > }
> > status = ocrdma_mbx_cmd(dev, (struct ocrdma_mqe *)cmd);
> > - if (status)
> > - goto mbx_err;
> > -mbx_err:
> > kfree(cmd);
> > return status;
> > }
>
>
> --
> Doug Ledford <[email protected]>
> GPG KeyID: 0E572FDD