Message ID | 20200519163612.GA6043@embeddedor (mailing list archive) |
---|---|
State | Mainlined |
Commit | e19840867013f0f4081265fdb65b31e80b7bcb5b |
Delegated to: | Jason Gunthorpe |
Headers | show |
Series | [v2] RDMA/rtrs: client: Fix function return on success | expand |
On 2020-05-19 09:36, Gustavo A. R. Silva wrote: > Remove the if-statement and return the value contained in _err_, > unconditionally. Thanks Gustavo! Reviewed-by: Bart Van Assche <bvanassche@acm.org>
On Tue, May 19, 2020 at 11:36:12AM -0500, Gustavo A. R. Silva wrote: > Remove the if-statement and return the value contained in _err_, > unconditionally. > > Addresses-Coverity-ID: 1493753 ("Identical code for different branches") > Fixes: 6a98d71daea1 ("RDMA/rtrs: client: main functionality") > Signed-off-by: Gustavo A. R. Silva <gustavoars@kernel.org> > Reviewed-by: Bart Van Assche <bvanassche@acm.org> > --- > Changes in v2: > - Return err, unconditionally. As suggested by Bart Van Assche. > Thanks, Bart. Applied to for-next, thanks Jason
diff --git a/drivers/infiniband/ulp/rtrs/rtrs-clt.c b/drivers/infiniband/ulp/rtrs/rtrs-clt.c index 468fdd0d8713c..568741aa7f596 100644 --- a/drivers/infiniband/ulp/rtrs/rtrs-clt.c +++ b/drivers/infiniband/ulp/rtrs/rtrs-clt.c @@ -1591,9 +1591,6 @@ static int create_con_cq_qp(struct rtrs_clt_con *con) * In case of error we do not bother to clean previous allocations, * since destroy_con_cq_qp() must be called. */ - - if (err) - return err; return err; }
Remove the if-statement and return the value contained in _err_, unconditionally. Addresses-Coverity-ID: 1493753 ("Identical code for different branches") Fixes: 6a98d71daea1 ("RDMA/rtrs: client: main functionality") Signed-off-by: Gustavo A. R. Silva <gustavoars@kernel.org> --- Changes in v2: - Return err, unconditionally. As suggested by Bart Van Assche. Thanks, Bart. drivers/infiniband/ulp/rtrs/rtrs-clt.c | 3 --- 1 file changed, 3 deletions(-)