diff options
author | Mike Christie <michaelc@cs.wisc.edu> | 2007-05-30 13:57:23 -0400 |
---|---|---|
committer | James Bottomley <jejb@mulgrave.il.steeleye.com> | 2007-06-02 15:36:46 -0400 |
commit | 4e7aba73f9f6e9fe6d3fa10d3fd63cd4882ba3d0 (patch) | |
tree | 89adec0555b294e0eed689b769cbc09e396af82a /drivers/scsi/iscsi_tcp.c | |
parent | 0ab823db869f1c9454c5b031a9b8f8812ccd0aa7 (diff) |
[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 <michaelc@cs.wisc.edu>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
Diffstat (limited to 'drivers/scsi/iscsi_tcp.c')
-rw-r--r-- | drivers/scsi/iscsi_tcp.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/scsi/iscsi_tcp.c b/drivers/scsi/iscsi_tcp.c index 4e9f0d9a55ea..7ce177e30a53 100644 --- a/drivers/scsi/iscsi_tcp.c +++ b/drivers/scsi/iscsi_tcp.c | |||
@@ -29,6 +29,7 @@ | |||
29 | #include <linux/types.h> | 29 | #include <linux/types.h> |
30 | #include <linux/list.h> | 30 | #include <linux/list.h> |
31 | #include <linux/inet.h> | 31 | #include <linux/inet.h> |
32 | #include <linux/file.h> | ||
32 | #include <linux/blkdev.h> | 33 | #include <linux/blkdev.h> |
33 | #include <linux/crypto.h> | 34 | #include <linux/crypto.h> |
34 | #include <linux/delay.h> | 35 | #include <linux/delay.h> |
@@ -1878,7 +1879,7 @@ iscsi_tcp_release_conn(struct iscsi_conn *conn) | |||
1878 | iscsi_conn_restore_callbacks(tcp_conn); | 1879 | iscsi_conn_restore_callbacks(tcp_conn); |
1879 | sock_put(tcp_conn->sock->sk); | 1880 | sock_put(tcp_conn->sock->sk); |
1880 | 1881 | ||
1881 | sock_release(tcp_conn->sock); | 1882 | sockfd_put(tcp_conn->sock); |
1882 | tcp_conn->sock = NULL; | 1883 | tcp_conn->sock = NULL; |
1883 | conn->recv_lock = NULL; | 1884 | conn->recv_lock = NULL; |
1884 | } | 1885 | } |