* [PATCH] iscsi: always release crypto
@ 2006-11-04 23:33 Pete Wyckoff
2006-11-06 18:06 ` Mike Christie
0 siblings, 1 reply; 2+ messages in thread
From: Pete Wyckoff @ 2006-11-04 23:33 UTC (permalink / raw)
To: linux-scsi
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>
---
diff --git a/drivers/scsi/iscsi_tcp.c b/drivers/scsi/iscsi_tcp.c
index 0a9dbc5..c0b8b33 100644
--- a/drivers/scsi/iscsi_tcp.c
+++ b/drivers/scsi/iscsi_tcp.c
@@ -1816,21 +1816,14 @@ iscsi_tcp_conn_destroy(struct iscsi_cls_
{
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);
}
^ permalink raw reply related [flat|nested] 2+ messages in thread
end of thread, other threads:[~2006-11-06 18:06 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-11-04 23:33 [PATCH] iscsi: always release crypto Pete Wyckoff
2006-11-06 18:06 ` Mike Christie
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.