mirror of
git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2025-09-18 22:14:16 +00:00
scsi: qla4xxx: Prevent a potential error pointer dereference
The qla4xxx_get_ep_fwdb() function is supposed to return NULL on error,
but qla4xxx_ep_connect() returns error pointers. Propagating the error
pointers will lead to an Oops in the caller, so change the error pointers
to NULL.
Fixes: 13483730a1
("[SCSI] qla4xxx: fix flash/ddb support")
Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org>
Link: https://lore.kernel.org/r/aJwnVKS9tHsw1tEu@stanley.mountain
Reviewed-by: Chris Leech <cleech@redhat.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
This commit is contained in:
parent
823f95575d
commit
9dcf111dd3
1 changed files with 2 additions and 0 deletions
|
@ -6606,6 +6606,8 @@ static struct iscsi_endpoint *qla4xxx_get_ep_fwdb(struct scsi_qla_host *ha,
|
|||
|
||||
ep = qla4xxx_ep_connect(ha->host, (struct sockaddr *)dst_addr, 0);
|
||||
vfree(dst_addr);
|
||||
if (IS_ERR(ep))
|
||||
return NULL;
|
||||
return ep;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue