]> Git Repo - linux.git/commitdiff
[SCSI] iscsi_tcp: fix fd leak
authorMike Christie <[email protected]>
Wed, 30 May 2007 17:57:23 +0000 (12:57 -0500)
committerJames Bottomley <[email protected]>
Sat, 2 Jun 2007 19:36:46 +0000 (15:36 -0400)
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 <[email protected]>
Signed-off-by: James Bottomley <[email protected]>
drivers/scsi/iscsi_tcp.c

index 4e9f0d9a55eaacabdc85443825d7ed460bdcb4ea..7ce177e30a530e8e5bb2267e24930c46e394f497 100644 (file)
@@ -29,6 +29,7 @@
 #include <linux/types.h>
 #include <linux/list.h>
 #include <linux/inet.h>
+#include <linux/file.h>
 #include <linux/blkdev.h>
 #include <linux/crypto.h>
 #include <linux/delay.h>
@@ -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;
 }
This page took 0.06216 seconds and 4 git commands to generate.