From aa012c30b56b9452d60e73427984dedc9e8c561c Mon Sep 17 00:00:00 2001 From: Himanshu Madhani Date: Thu, 25 Sep 2014 06:14:44 -0400 Subject: [PATCH] qla2xxx: fix kernel NULL pointer access This patch is to fix regression added by commit id 1609c24dc7e6e608ad16a42cec7e84d64c60eb38. When allocating memory for new session original patch does not assign vha to op->vha resulting into NULL pointer access during qlt_create_sess_from_atio(). Cc: Signed-off-by: Himanshu Madhani Signed-off-by: Saurav Kashyap Signed-off-by: Christoph Hellwig --- drivers/scsi/qla2xxx/qla_target.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/scsi/qla2xxx/qla_target.c b/drivers/scsi/qla2xxx/qla_target.c index aebe62c9246d7..43f91778371bd 100644 --- a/drivers/scsi/qla2xxx/qla_target.c +++ b/drivers/scsi/qla2xxx/qla_target.c @@ -3277,6 +3277,7 @@ static int qlt_handle_cmd_for_atio(struct scsi_qla_host *vha, return -ENOMEM; memcpy(&op->atio, atio, sizeof(*atio)); + op->vha = vha; INIT_WORK(&op->work, qlt_create_sess_from_atio); queue_work(qla_tgt_wq, &op->work); return 0; -- 2.39.5