struct iser_conn *iser_conn = task->conn->dd_data;
struct iser_device *device = iser_conn->ib_conn.device;
+ /* DEVICE_REMOVAL event might have already released the device */
+ if (!device)
+ return;
+
ib_dma_unmap_single(device->ib_device,
tx_desc->dma_addr, ISER_HEADERS_LEN, DMA_TO_DEVICE);
struct iser_conn *iser_conn = conn->dd_data;
iser_dbg("stopping iscsi_conn: %p, iser_conn: %p\n", conn, iser_conn);
- iscsi_conn_stop(cls_conn, flag);
/*
* Userspace may have goofed up and not bound the connection or
*/
if (iser_conn) {
mutex_lock(&iser_conn->state_mutex);
+ iscsi_conn_stop(cls_conn, flag);
iser_conn_terminate(iser_conn);
/* unbind */
complete(&iser_conn->stop_completion);
mutex_unlock(&iser_conn->state_mutex);
+ } else {
+ iscsi_conn_stop(cls_conn, flag);
}
}