Skip to contentSkip to conversation

RDMA/rtrs: client: Fix function return on success

PATCH Applied Gustavo A. R. Silva 3 participants 3 messages May 19, 2020

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 RDMA/rtrs: client: Fix function return on success

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")

---
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(-)
drivers/infiniband/ulp/rtrs/rtrs-clt.c +0 -3
index 468fdd0d8713c..568741aa7f596 100644
@@ -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;
 }
 
Signature · 1 line
2.26.2
#2 lore raw
In reply to Gustavo A. R. Silva
Quoted 11 lines · Gustavo A. R. Silva

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")

---
Changes in v2:
- Return err, unconditionally. As suggested by Bart Van Assche. Thanks, Bart.

Applied to for-next, thanks

Jason