summaryrefslogtreecommitdiffstats
path: root/drivers/scsi/iscsi_tcp.c
diff options
context:
space:
mode:
authorPete Wyckoff2006-11-08 22:58:31 +0100
committerJames Bottomley2006-11-10 01:41:40 +0100
commit534284a09b3f58cd92acd0652b7267ee142932ba (patch)
tree15c2b207e88fbab869d1bc1fa4858de3db464f3c /drivers/scsi/iscsi_tcp.c
parent[SCSI] sg: fix incorrect last scatg length (diff)
downloadkernel-qcow2-linux-534284a09b3f58cd92acd0652b7267ee142932ba.tar.gz
kernel-qcow2-linux-534284a09b3f58cd92acd0652b7267ee142932ba.tar.xz
kernel-qcow2-linux-534284a09b3f58cd92acd0652b7267ee142932ba.zip
[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/scsi/iscsi_tcp.c')
-rw-r--r--drivers/scsi/iscsi_tcp.c15
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)
{
struct iscsi_conn *conn = cls_conn->dd_data;
struct iscsi_tcp_conn *tcp_conn = conn->dd_data;
- int digest = 0;
-
- if (conn->hdrdgst_en || conn->datadgst_en)
- digest = 1;
iscsi_tcp_release_conn(conn);
iscsi_conn_teardown(cls_conn);
- /* now free tcp_conn */
- if (digest) {
- if (tcp_conn->tx_hash.tfm)
- crypto_free_hash(tcp_conn->tx_hash.tfm);
- if (tcp_conn->rx_hash.tfm)
- crypto_free_hash(tcp_conn->rx_hash.tfm);
- }
+ if (tcp_conn->tx_hash.tfm)
+ crypto_free_hash(tcp_conn->tx_hash.tfm);
+ if (tcp_conn->rx_hash.tfm)
+ crypto_free_hash(tcp_conn->rx_hash.tfm);
kfree(tcp_conn);
}