@@ -610,17 +610,15 @@ void iser_snd_completion(struct iser_tx_desc *tx_desc,
ib_dma_unmap_single(device->ib_device, tx_desc->dma_addr,
ISER_HEADERS_LEN, DMA_TO_DEVICE);
kmem_cache_free(ig.desc_cache, tx_desc);
- }
-
- atomic_dec(&ib_conn->post_send_buf_count);
-
- if (tx_desc->type == ISCSI_TX_CONTROL) {
+ } else if (tx_desc->type == ISCSI_TX_CONTROL) {
/* this arithmetic is legal by libiscsi dd_data allocation */
task = (void *) ((long)(void *)tx_desc -
sizeof(struct iscsi_task));
if (task->hdr->itt == RESERVED_ITT)
iscsi_put_task(task);
}
+
+ atomic_dec(&ib_conn->post_send_buf_count);
}
void iser_task_rdma_init(struct iscsi_iser_task *iser_task)
The tx_desc variable is being used to access its type member after a kmem_cache_free call Signed-off-by: Felipe Pena <felipensp@gmail.com> --- drivers/infiniband/ulp/iser/iser_initiator.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-)