Skip to contentSkip to conversation

bnx2i: missing error code in bnx2i_ep_connect()

PATCH Applied Dan Carpenter 3 participants 3 messages Jun 23, 2017 – Jun 26, 2017

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 bnx2i: missing error code in bnx2i_ep_connect()

If bnx2i_map_ep_dbell_regs() then we accidentally return NULL instead of an error pointer. It results in a NULL dereference in iscsi_if_ep_connect().

Fixes cf4e6363859d ("[SCSI] bnx2i: Add bnx2i iSCSI driver.")
drivers/scsi/bnx2i/bnx2i_iscsi.c +2 -1
index f32a66f89d25..03c104b47f31 100644
@@ -1909,7 +1909,8 @@ static struct iscsi_endpoint *bnx2i_ep_connect(struct Scsi_Host *shost,
 
 	bnx2i_ep_active_list_add(hba, bnx2i_ep);
 
-	if (bnx2i_map_ep_dbell_regs(bnx2i_ep))
+	rc = bnx2i_map_ep_dbell_regs(bnx2i_ep);
+	if (rc)
 		goto del_active_ep;
 
 	mutex_unlock(&hba->net_dev_lock);
Reviewed-by on v1 1/1
#1 lore raw
Quoted 7 lines · Dan Carpenter

If bnx2i_map_ep_dbell_regs() then we accidentally return NULL instead of an error pointer. It results in a NULL dereference in iscsi_if_ep_connect().

Fixes cf4e6363859d ("[SCSI] bnx2i: Add bnx2i iSCSI driver.")

Looks good,

Signature · 10 lines
Johannes Thumshirn                                          Storage
[email protected]                                +49 911 74053 689
SUSE LINUX GmbH, Maxfeldstr. 5, 90409 Nürnberg
GF: Felix Imendörffer, Jane Smithard, Graham Norton
HRB 21284 (AG Nürnberg)
Key fingerprint = EC38 9CAB C2C4 F25D 8600 D0D0 0393 969D 2D76 0850
--
To unsubscribe from this list: send the line "unsubscribe kernel-janitors" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
#2 lore raw
In reply to Dan Carpenter

Dan,

Quoted 3 lines

If bnx2i_map_ep_dbell_regs() then we accidentally return NULL instead of an error pointer. It results in a NULL dereference in iscsi_if_ep_connect().

Applied to 4.13/scsi-queue, thanks!

Signature · 1 line
Martin K. Petersen	Oracle Linux Engineering