]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/blame - queue-4.4/scsi-qla4xxx-fix-a-potential-null-pointer-dereferenc.patch
4.4-stable patches
[thirdparty/kernel/stable-queue.git] / queue-4.4 / scsi-qla4xxx-fix-a-potential-null-pointer-dereferenc.patch
CommitLineData
dcd32332
SL
1From 22ba4acc3cef0061d77cc01b18a82140b3d8c9f8 Mon Sep 17 00:00:00 2001
2From: Kangjie Lu <kjlu@umn.edu>
3Date: Thu, 14 Mar 2019 01:30:59 -0500
4Subject: scsi: qla4xxx: fix a potential NULL pointer dereference
5
6[ Upstream commit fba1bdd2a9a93f3e2181ec1936a3c2f6b37e7ed6 ]
7
8In case iscsi_lookup_endpoint fails, the fix returns -EINVAL to avoid NULL
9pointer dereference.
10
11Signed-off-by: Kangjie Lu <kjlu@umn.edu>
12Acked-by: Manish Rangankar <mrangankar@marvell.com>
13Reviewed-by: Mukesh Ojha <mojha@codeaurora.org>
14Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
15Signed-off-by: Sasha Levin (Microsoft) <sashal@kernel.org>
16---
17 drivers/scsi/qla4xxx/ql4_os.c | 2 ++
18 1 file changed, 2 insertions(+)
19
20diff --git a/drivers/scsi/qla4xxx/ql4_os.c b/drivers/scsi/qla4xxx/ql4_os.c
21index f9f899ec9427..c158967b59d7 100644
22--- a/drivers/scsi/qla4xxx/ql4_os.c
23+++ b/drivers/scsi/qla4xxx/ql4_os.c
24@@ -3207,6 +3207,8 @@ static int qla4xxx_conn_bind(struct iscsi_cls_session *cls_session,
25 if (iscsi_conn_bind(cls_session, cls_conn, is_leading))
26 return -EINVAL;
27 ep = iscsi_lookup_endpoint(transport_fd);
28+ if (!ep)
29+ return -EINVAL;
30 conn = cls_conn->dd_data;
31 qla_conn = conn->dd_data;
32 qla_conn->qla_ep = ep->dd_data;
33--
342.19.1
35