提交 9a87a320 编写于 作者: K Kangjie Lu 提交者: Xie XiuQi

scsi: qla4xxx: fix a potential NULL pointer dereference

[ Upstream commit fba1bdd2 ]

In case iscsi_lookup_endpoint fails, the fix returns -EINVAL to avoid NULL
pointer dereference.
Signed-off-by: NKangjie Lu <kjlu@umn.edu>
Acked-by: NManish Rangankar <mrangankar@marvell.com>
Reviewed-by: NMukesh Ojha <mojha@codeaurora.org>
Signed-off-by: NMartin K. Petersen <martin.petersen@oracle.com>
Signed-off-by: NSasha Levin (Microsoft) <sashal@kernel.org>
Signed-off-by: NYang Yingliang <yangyingliang@huawei.com>
上级 f48ec5be
...@@ -3204,6 +3204,8 @@ static int qla4xxx_conn_bind(struct iscsi_cls_session *cls_session, ...@@ -3204,6 +3204,8 @@ static int qla4xxx_conn_bind(struct iscsi_cls_session *cls_session,
if (iscsi_conn_bind(cls_session, cls_conn, is_leading)) if (iscsi_conn_bind(cls_session, cls_conn, is_leading))
return -EINVAL; return -EINVAL;
ep = iscsi_lookup_endpoint(transport_fd); ep = iscsi_lookup_endpoint(transport_fd);
if (!ep)
return -EINVAL;
conn = cls_conn->dd_data; conn = cls_conn->dd_data;
qla_conn = conn->dd_data; qla_conn = conn->dd_data;
qla_conn->qla_ep = ep->dd_data; qla_conn->qla_ep = ep->dd_data;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册