[PATCH 2/2] iscsi_tcp: disallow binding the same connection twice

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



iscsi_sw_tcp_conn_bind does not check or cleanup previously bound
sockets, nor should we allow binding the same connection twice.

Signed-off-by: Khazhismel Kumykov <khazhy@xxxxxxxxxx>
---
 drivers/scsi/iscsi_tcp.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/drivers/scsi/iscsi_tcp.c b/drivers/scsi/iscsi_tcp.c
index e8ed60b777c6..8cf5dc203a82 100644
--- a/drivers/scsi/iscsi_tcp.c
+++ b/drivers/scsi/iscsi_tcp.c
@@ -716,6 +716,9 @@ iscsi_sw_tcp_conn_bind(struct iscsi_cls_session *cls_session,
 	struct socket *sock;
 	int err;
 
+	if (tcp_sw_conn->sock)
+		return -EINVAL;
+
 	/* lookup for existing socket */
 	sock = sockfd_lookup((int)transport_eph, &err);
 	if (!sock) {
-- 
2.44.0.291.gc1ea87d7ee-goog





[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [SCSI Target Devel]     [Linux SCSI Target Infrastructure]     [Kernel Newbies]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Linux IIO]     [Samba]     [Device Mapper]

  Powered by Linux