Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1637174
| From | Colin King <colin.king@canonical.com> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | [PATCH] scsi: qla4xxx: check for null return from iscsi_lookup_endpoint |
| Date | 2017-05-08 02:10 +0200 |
| Message-ID | <tEEps-4L8-11@gated-at.bofh.it> (permalink) |
| Organization | linux.* mail to news gateway |
From: Colin Ian King <colin.king@canonical.com>
iscsi_lookup_endpoint can potentially return null and in 9 out of
the 10 calls to this function a null return is checked, so I think
it is pertinent to perform a null check here too and return -EINVAL
as in the other null cases.
Detected by CoverityScan, CID#147282 ("Dereference null return value")
Signed-off-by: Colin Ian King <colin.king@canonical.com>
---
drivers/scsi/qla4xxx/ql4_os.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/drivers/scsi/qla4xxx/ql4_os.c b/drivers/scsi/qla4xxx/ql4_os.c
index 64c6fa563fdb..803e342e1093 100644
--- a/drivers/scsi/qla4xxx/ql4_os.c
+++ b/drivers/scsi/qla4xxx/ql4_os.c
@@ -3189,6 +3189,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;
--
2.11.0
Back to linux.kernel | Previous | Next — Next in thread | Find similar | Unroll thread
[PATCH] scsi: qla4xxx: check for null return from iscsi_lookup_endpoint Colin King <colin.king@canonical.com> - 2017-05-08 02:10 +0200 Re: [PATCH] scsi: qla4xxx: check for null return from iscsi_lookup_endpoint Dan Carpenter <dan.carpenter@oracle.com> - 2017-05-08 14:20 +0200
csiph-web