diff options
author | Pete Wyckoff <pw@osc.edu> | 2006-11-08 16:58:31 -0500 |
---|---|---|
committer | James Bottomley <jejb@mulgrave.(none)> | 2006-11-09 19:41:40 -0500 |
commit | 534284a09b3f58cd92acd0652b7267ee142932ba (patch) | |
tree | 15c2b207e88fbab869d1bc1fa4858de3db464f3c /drivers | |
parent | 7ca63cb470f23a197f187afe936d4bf806197d6e (diff) |
[SCSI] iscsi: always release crypto
Unconditionally free crypto state, as it is always allocated during
TCP connection creation. Without this, crypto structures leak and
crc32c module refcounts grow as connections are created and
destroyed.
Signed-off-by: Pete Wyckoff <pw@osc.edu>
Signed-off-by: Mike Christie <michaelc@cs.wisc.edu>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/scsi/iscsi_tcp.c | 15 |
1 files changed, 4 insertions, 11 deletions
diff --git a/drivers/scsi/iscsi_tcp.c b/drivers/scsi/iscsi_tcp.c index 0a9dbc59663f..c0b8b33e935c 100644 --- a/drivers/scsi/iscsi_tcp.c +++ b/drivers/scsi/iscsi_tcp.c | |||
@@ -1816,21 +1816,14 @@ iscsi_tcp_conn_destroy(struct iscsi_cls_conn *cls_conn) | |||
1816 | { | 1816 | { |
1817 | struct iscsi_conn *conn = cls_conn->dd_data; | 1817 | struct iscsi_conn *conn = cls_conn->dd_data; |
1818 | struct iscsi_tcp_conn *tcp_conn = conn->dd_data; | 1818 | struct iscsi_tcp_conn *tcp_conn = conn->dd_data; |
1819 | int digest = 0; | ||
1820 | |||
1821 | if (conn->hdrdgst_en || conn->datadgst_en) | ||
1822 | digest = 1; | ||
1823 | 1819 | ||
1824 | iscsi_tcp_release_conn(conn); | 1820 | iscsi_tcp_release_conn(conn); |
1825 | iscsi_conn_teardown(cls_conn); | 1821 | iscsi_conn_teardown(cls_conn); |
1826 | 1822 | ||
1827 | /* now free tcp_conn */ | 1823 | if (tcp_conn->tx_hash.tfm) |
1828 | if (digest) { | 1824 | crypto_free_hash(tcp_conn->tx_hash.tfm); |
1829 | if (tcp_conn->tx_hash.tfm) | 1825 | if (tcp_conn->rx_hash.tfm) |
1830 | crypto_free_hash(tcp_conn->tx_hash.tfm); | 1826 | crypto_free_hash(tcp_conn->rx_hash.tfm); |
1831 | if (tcp_conn->rx_hash.tfm) | ||
1832 | crypto_free_hash(tcp_conn->rx_hash.tfm); | ||
1833 | } | ||
1834 | 1827 | ||
1835 | kfree(tcp_conn); | 1828 | kfree(tcp_conn); |
1836 | } | 1829 | } |