Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit a3d1c9bc authored by Kangjie Lu's avatar Kangjie Lu Committed by Greg Kroah-Hartman
Browse files

scsi: qla4xxx: fix a potential NULL pointer dereference



[ Upstream commit fba1bdd2a9a93f3e2181ec1936a3c2f6b37e7ed6 ]

In case iscsi_lookup_endpoint fails, the fix returns -EINVAL to avoid NULL
pointer dereference.

Signed-off-by: default avatarKangjie Lu <kjlu@umn.edu>
Acked-by: default avatarManish Rangankar <mrangankar@marvell.com>
Reviewed-by: default avatarMukesh Ojha <mojha@codeaurora.org>
Signed-off-by: default avatarMartin K. Petersen <martin.petersen@oracle.com>
Signed-off-by: default avatarSasha Levin (Microsoft) <sashal@kernel.org>
parent 9842f4ce
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -3207,6 +3207,8 @@ static int qla4xxx_conn_bind(struct iscsi_cls_session *cls_session,
	if (iscsi_conn_bind(cls_session, cls_conn, is_leading))
		return -EINVAL;
	ep = iscsi_lookup_endpoint(transport_fd);
	if (!ep)
		return -EINVAL;
	conn = cls_conn->dd_data;
	qla_conn = conn->dd_data;
	qla_conn->qla_ep = ep->dd_data;