Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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 <jiazhouyang09@gmail.com>
Reviewed-by: Johannes Thumshirn <jthumshirn@suse.de>
Acked-by: Manish Rangankar <Manish.Rangankar@cavium.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>

authored by

Zhouyang Jia and committed by
Martin K. Petersen
aa154ea8 2da11d42

+2
+2
drivers/scsi/bnx2i/bnx2i_hwi.c
··· 2727 2727 BNX2X_DOORBELL_PCI_BAR); 2728 2728 reg_off = (1 << BNX2X_DB_SHIFT) * (cid_num & 0x1FFFF); 2729 2729 ep->qp.ctx_base = ioremap_nocache(reg_base + reg_off, 4); 2730 + if (!ep->qp.ctx_base) 2731 + return -ENOMEM; 2730 2732 goto arm_cq; 2731 2733 } 2732 2734