Skip to content

Commit f4bc3cd

Browse files
Dan Carpentergregkh
authored andcommitted
scsi: qla4xxx: Prevent a potential error pointer dereference
[ Upstream commit 9dcf111 ] 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: 1348373 ("[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> Signed-off-by: Sasha Levin <sashal@kernel.org>
1 parent 1ec37e5 commit f4bc3cd

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

drivers/scsi/qla4xxx/ql4_os.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6606,6 +6606,8 @@ static struct iscsi_endpoint *qla4xxx_get_ep_fwdb(struct scsi_qla_host *ha,
66066606

66076607
ep = qla4xxx_ep_connect(ha->host, (struct sockaddr *)dst_addr, 0);
66086608
vfree(dst_addr);
6609+
if (IS_ERR(ep))
6610+
return NULL;
66096611
return ep;
66106612
}
66116613

0 commit comments

Comments
 (0)