Skip to contentSkip to conversation

csi: libcxgbi: remove redundant check and close on csk

PATCH Applied Colin King 3 participants 3 messages Sep 7, 2017 – Sep 16, 2017

Subsystems (2)
lore
Share & tools
lore

Colin King

author
#0 lore raw

PATCH 1/1 csi: libcxgbi: remove redundant check and close on csk

From: Colin Ian King <[email protected]>

csk is always null on the error return path and so the non-null check and call to cxgbi_sock_closed on csk is redundant and can be removed.

Detected by: CoverityScan CID#114329 ("Logically dead code")

---
 drivers/scsi/cxgbi/libcxgbi.c | 2 --
 1 file changed, 2 deletions(-)
drivers/scsi/cxgbi/libcxgbi.c +0 -2
index 512c8f1ea5b0..da36c2de069e 100644
@@ -688,8 +688,6 @@ cxgbi_check_route(struct sockaddr *dst_addr, int ifindex)
 
 rel_rt:
 	ip_rt_put(rt);
-	if (csk)
-		cxgbi_sock_closed(csk);
 err_out:
 	return ERR_PTR(err);
 }
Signature · 1 line
2.14.1
Acked-by on v1 1/1
#1 lore raw
Quoted 18 lines · Colin King

From: Colin Ian King <[email protected]>

csk is always null on the error return path and so the non-null check and call to cxgbi_sock_closed on csk is redundant and can be removed.

Detected by: CoverityScan CID#114329 ("Logically dead code")

---
 drivers/scsi/cxgbi/libcxgbi.c | 2 --
 1 file changed, 2 deletions(-)
drivers/scsi/cxgbi/libcxgbi.c +0 -0
index 512c8f1ea5b0..da36c2de069e 100644

drivers/scsi/cxgbi/libcxgbi.c cxgbi_check_route(struct sockaddr *dst_addr, int ifindex) · line 693

Quoted 8 lines
drivers/scsi/cxgbi/libcxgbi.c +0 -2
@@ -688,8 +688,6 @@ cxgbi_check_route(struct sockaddr *dst_addr, int ifindex)
 
 rel_rt:
 	ip_rt_put(rt);
-	if (csk)
-		cxgbi_sock_closed(csk);
 err_out:
 	return ERR_PTR(err);
 }
#2 lore raw
In reply to Colin King

Colin,

Quoted 2 lines

csk is always null on the error return path and so the non-null check and call to cxgbi_sock_closed on csk is redundant and can be removed.

Applied to 4.15/scsi-queue.

Signature · 1 line
Martin K. Petersen	Oracle Linux Engineering