diff options
author | Zhouyang Jia <jiazhouyang09@gmail.com> | 2018-06-12 11:13:00 +0800 |
---|---|---|
committer | Martin K. Petersen <martin.petersen@oracle.com> | 2018-06-19 22:02:25 -0400 |
commit | aa154ea885eb0c2407457ce9c1538d78c95456fa (patch) | |
tree | 59749bd63b907b4be8046a38ca0bb78460159908 | |
parent | 2da11d4262639dc0e2fabc6a70886db57af25c43 (diff) | |
download | linux-stable-aa154ea885eb0c2407457ce9c1538d78c95456fa.tar.gz linux-stable-aa154ea885eb0c2407457ce9c1538d78c95456fa.tar.bz2 linux-stable-aa154ea885eb0c2407457ce9c1538d78c95456fa.zip |
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>
-rw-r--r-- | drivers/scsi/bnx2i/bnx2i_hwi.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/scsi/bnx2i/bnx2i_hwi.c b/drivers/scsi/bnx2i/bnx2i_hwi.c index 8f03a869ac98..e9e669a6c2bc 100644 --- a/drivers/scsi/bnx2i/bnx2i_hwi.c +++ b/drivers/scsi/bnx2i/bnx2i_hwi.c @@ -2727,6 +2727,8 @@ int bnx2i_map_ep_dbell_regs(struct bnx2i_endpoint *ep) BNX2X_DOORBELL_PCI_BAR); reg_off = (1 << BNX2X_DB_SHIFT) * (cid_num & 0x1FFFF); ep->qp.ctx_base = ioremap_nocache(reg_base + reg_off, 4); + if (!ep->qp.ctx_base) + return -ENOMEM; goto arm_cq; } |