* [PATCH] scsi: libcxgbi: add check for valid cxgbi_task_data
@ 2017-07-23 14:31 Varun Prakash
2017-07-25 2:16 ` Martin K. Petersen
0 siblings, 1 reply; 2+ messages in thread
From: Varun Prakash @ 2017-07-23 14:31 UTC (permalink / raw)
To: martin.petersen; +Cc: linux-scsi, indranil, varun
In error case it is possible that ->cleanup_task()
gets called without calling ->alloc_pdu() in this case
cxgbi_task_data is not valid, so add a check for
for valid cxgbi_task_data in cxgbi_cleanup_task().
Signed-off-by: Varun Prakash <varun@chelsio.com>
---
drivers/scsi/cxgbi/libcxgbi.c | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/drivers/scsi/cxgbi/libcxgbi.c b/drivers/scsi/cxgbi/libcxgbi.c
index e4c83b7..1a4cfa5 100644
--- a/drivers/scsi/cxgbi/libcxgbi.c
+++ b/drivers/scsi/cxgbi/libcxgbi.c
@@ -2128,6 +2128,13 @@ void cxgbi_cleanup_task(struct iscsi_task *task)
struct iscsi_tcp_task *tcp_task = task->dd_data;
struct cxgbi_task_data *tdata = iscsi_task_cxgbi_data(task);
+ if (!tcp_task || !tdata || (tcp_task->dd_data != tdata)) {
+ pr_info("task 0x%p,0x%p, tcp_task 0x%p, tdata 0x%p/0x%p.\n",
+ task, task->sc, tcp_task,
+ tcp_task ? tcp_task->dd_data : NULL, tdata);
+ return;
+ }
+
log_debug(1 << CXGBI_DBG_ISCSI,
"task 0x%p, skb 0x%p, itt 0x%x.\n",
task, tdata->skb, task->hdr_itt);
--
2.0.2
^ permalink raw reply related [flat|nested] 2+ messages in thread
end of thread, other threads:[~2017-07-25 2:16 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-07-23 14:31 [PATCH] scsi: libcxgbi: add check for valid cxgbi_task_data Varun Prakash
2017-07-25 2:16 ` Martin K. Petersen
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox