From: Mike Christie Date: Wed, 30 May 2007 17:57:23 +0000 (-0500) Subject: [SCSI] iscsi_tcp: fix fd leak X-Git-Tag: v2.6.23-rc1~1053^2~77 X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=4e7aba73f9f6e9fe6d3fa10d3fd63cd4882ba3d0;p=linux-2.6 [SCSI] iscsi_tcp: fix fd leak This patch should fix the file descriptor leak problem. A quick look through the kernel shows that users of sockfd_lookup use sockfd_put to release their handle. We were using sock_release which from the comments and code look like it does not release the get() on the file from the lookup. Signed-off-by: Mike Christie Signed-off-by: James Bottomley --- diff --git a/drivers/scsi/iscsi_tcp.c b/drivers/scsi/iscsi_tcp.c index 4e9f0d9a55..7ce177e30a 100644 --- a/drivers/scsi/iscsi_tcp.c +++ b/drivers/scsi/iscsi_tcp.c @@ -29,6 +29,7 @@ #include #include #include +#include #include #include #include @@ -1878,7 +1879,7 @@ iscsi_tcp_release_conn(struct iscsi_conn *conn) iscsi_conn_restore_callbacks(tcp_conn); sock_put(tcp_conn->sock->sk); - sock_release(tcp_conn->sock); + sockfd_put(tcp_conn->sock); tcp_conn->sock = NULL; conn->recv_lock = NULL; }