mirror of
https://github.com/SCST-project/scst.git
synced 2026-05-20 12:11:26 +00:00
isert: clean tmo timer when freeing the connection
The tmo timer is set when allocating a new connection. We need to release it in case it didn't execute yet. Else timer execution will lead to a NULL dereference bug on conn. Signed-off-by: Israel Rukshin <israelr@mellanox.com> git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@6878 d57e44dd-8a1f-0410-8b47-8ef2f437770f
This commit is contained in:
@@ -42,6 +42,7 @@
|
||||
|
||||
#include "isert_dbg.h"
|
||||
#include "iser.h"
|
||||
#include "isert.h"
|
||||
#include "iser_datamover.h"
|
||||
|
||||
#define ISER_CQ_ENTRIES (128 * 1024)
|
||||
@@ -1255,6 +1256,7 @@ static void isert_deref_device(struct isert_device *isert_dev)
|
||||
|
||||
static void isert_kref_free(struct kref *kref)
|
||||
{
|
||||
struct isert_conn_dev *dev;
|
||||
struct isert_connection *isert_conn = container_of(kref,
|
||||
struct isert_connection,
|
||||
kref);
|
||||
@@ -1268,6 +1270,11 @@ static void isert_kref_free(struct kref *kref)
|
||||
isert_free_conn_resources(isert_conn);
|
||||
|
||||
rdma_destroy_id(isert_conn->cm_id);
|
||||
|
||||
dev = isert_get_priv(&isert_conn->iscsi);
|
||||
if (dev)
|
||||
isert_del_timer(dev);
|
||||
|
||||
ib_destroy_qp(isert_conn->qp);
|
||||
isert_conn->qp = NULL;
|
||||
|
||||
|
||||
@@ -131,5 +131,6 @@ int isert_conn_alloc(struct iscsi_session *session,
|
||||
struct iscsit_transport *t);
|
||||
int isert_handle_close_connection(struct iscsi_conn *conn);
|
||||
void isert_close_all_portals(void);
|
||||
void isert_del_timer(struct isert_conn_dev *dev);
|
||||
|
||||
#endif /* __ISERT_H__ */
|
||||
|
||||
@@ -83,7 +83,7 @@ static struct isert_conn_dev *get_available_dev(struct isert_listener_dev *dev,
|
||||
return res;
|
||||
}
|
||||
|
||||
static void isert_del_timer(struct isert_conn_dev *dev)
|
||||
void isert_del_timer(struct isert_conn_dev *dev)
|
||||
{
|
||||
if (dev->timer_active) {
|
||||
dev->timer_active = 0;
|
||||
|
||||
Reference in New Issue
Block a user