Skip to content

Commit aa154ea

Browse files
ZhouyangJiamartinkpetersen
authored andcommitted
scsi: bnx2i: add error handling for ioremap_nocache
When ioremap_nocache fails, the lack of error-handling code may cause unexpected results. This patch adds error-handling code after calling ioremap_nocache. Signed-off-by: Zhouyang Jia <[email protected]> Reviewed-by: Johannes Thumshirn <[email protected]> Acked-by: Manish Rangankar <[email protected]> Signed-off-by: Martin K. Petersen <[email protected]>
1 parent 2da11d4 commit aa154ea

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

drivers/scsi/bnx2i/bnx2i_hwi.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2727,6 +2727,8 @@ int bnx2i_map_ep_dbell_regs(struct bnx2i_endpoint *ep)
27272727
BNX2X_DOORBELL_PCI_BAR);
27282728
reg_off = (1 << BNX2X_DB_SHIFT) * (cid_num & 0x1FFFF);
27292729
ep->qp.ctx_base = ioremap_nocache(reg_base + reg_off, 4);
2730+
if (!ep->qp.ctx_base)
2731+
return -ENOMEM;
27302732
goto arm_cq;
27312733
}
27322734

0 commit comments

Comments
 (0)