diff options
| author | Kangjie Lu <kjlu@umn.edu> | 2019-03-14 02:30:59 -0400 |
|---|---|---|
| committer | Martin K. Petersen <martin.petersen@oracle.com> | 2019-03-25 22:24:30 -0400 |
| commit | fba1bdd2a9a93f3e2181ec1936a3c2f6b37e7ed6 (patch) | |
| tree | 5f398a1ac62f492a70aa3a0cff75cfbc6ac591c1 | |
| parent | b6554cfe09e1f610aed7d57164ab7760be57acd9 (diff) | |
scsi: qla4xxx: fix a potential NULL pointer dereference
In case iscsi_lookup_endpoint fails, the fix returns -EINVAL to avoid NULL
pointer dereference.
Signed-off-by: Kangjie Lu <kjlu@umn.edu>
Acked-by: Manish Rangankar <mrangankar@marvell.com>
Reviewed-by: Mukesh Ojha <mojha@codeaurora.org>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
| -rw-r--r-- | drivers/scsi/qla4xxx/ql4_os.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/scsi/qla4xxx/ql4_os.c b/drivers/scsi/qla4xxx/ql4_os.c index 16a18d5d856f..6e4f4931ae17 100644 --- a/drivers/scsi/qla4xxx/ql4_os.c +++ b/drivers/scsi/qla4xxx/ql4_os.c | |||
| @@ -3203,6 +3203,8 @@ static int qla4xxx_conn_bind(struct iscsi_cls_session *cls_session, | |||
| 3203 | if (iscsi_conn_bind(cls_session, cls_conn, is_leading)) | 3203 | if (iscsi_conn_bind(cls_session, cls_conn, is_leading)) |
| 3204 | return -EINVAL; | 3204 | return -EINVAL; |
| 3205 | ep = iscsi_lookup_endpoint(transport_fd); | 3205 | ep = iscsi_lookup_endpoint(transport_fd); |
| 3206 | if (!ep) | ||
| 3207 | return -EINVAL; | ||
| 3206 | conn = cls_conn->dd_data; | 3208 | conn = cls_conn->dd_data; |
| 3207 | qla_conn = conn->dd_data; | 3209 | qla_conn = conn->dd_data; |
| 3208 | qla_conn->qla_ep = ep->dd_data; | 3210 | qla_conn->qla_ep = ep->dd_data; |
