From: Himanshu Madhani Date: Thu, 25 Sep 2014 10:14:44 +0000 (-0400) Subject: qla2xxx: fix kernel NULL pointer access X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=78c2106a50e067f7168ee8c0944baaeb0e988272;p=GitHub%2FLineageOS%2Fandroid_kernel_motorola_exynos9610.git qla2xxx: fix kernel NULL pointer access This patch is to fix regression added by commit id 51a07f84649d2be206c4c2ad9a612956db0c2f8c. 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 --- diff --git a/drivers/scsi/qla2xxx/qla_target.c b/drivers/scsi/qla2xxx/qla_target.c index aebe62c9246d..43f91778371b 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;