Commit 2c675218 authored by Dan Carpenter's avatar Dan Carpenter Committed by Martin K. Petersen

scsi: qedi: Fix return code in qedi_ep_connect()

We shouldn't be writing over the "ret" variable.  It means we return
ERR_PTR(0) which is NULL and it results in a NULL dereference in the
caller.

Fixes: ace7f46b ("scsi: qedi: Add QLogic FastLinQ offload iSCSI driver framework.")
Signed-off-by: default avatarDan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: default avatarMartin K. Petersen <martin.petersen@oracle.com>
parent cd069bb9
...@@ -824,7 +824,7 @@ qedi_ep_connect(struct Scsi_Host *shost, struct sockaddr *dst_addr, ...@@ -824,7 +824,7 @@ qedi_ep_connect(struct Scsi_Host *shost, struct sockaddr *dst_addr,
u32 iscsi_cid = QEDI_CID_RESERVED; u32 iscsi_cid = QEDI_CID_RESERVED;
u16 len = 0; u16 len = 0;
char *buf = NULL; char *buf = NULL;
int ret; int ret, tmp;
if (!shost) { if (!shost) {
ret = -ENXIO; ret = -ENXIO;
...@@ -940,10 +940,10 @@ qedi_ep_connect(struct Scsi_Host *shost, struct sockaddr *dst_addr, ...@@ -940,10 +940,10 @@ qedi_ep_connect(struct Scsi_Host *shost, struct sockaddr *dst_addr,
ep_rel_conn: ep_rel_conn:
qedi->ep_tbl[iscsi_cid] = NULL; qedi->ep_tbl[iscsi_cid] = NULL;
ret = qedi_ops->release_conn(qedi->cdev, qedi_ep->handle); tmp = qedi_ops->release_conn(qedi->cdev, qedi_ep->handle);
if (ret) if (tmp)
QEDI_WARN(&qedi->dbg_ctx, "release_conn returned %d\n", QEDI_WARN(&qedi->dbg_ctx, "release_conn returned %d\n",
ret); tmp);
ep_free_sq: ep_free_sq:
qedi_free_sq(qedi, qedi_ep); qedi_free_sq(qedi, qedi_ep);
ep_conn_exit: ep_conn_exit:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment