diff options
author | Kangjie Lu <kjlu@umn.edu> | 2019-03-09 00:49:34 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2019-03-10 13:58:08 -0400 |
commit | d721fe99f6ada070ae8fc0ec3e01ce5a42def0d9 (patch) | |
tree | 725847cb7c0b2485003ff9a65a3f52a40c9e6d60 /drivers/isdn | |
parent | 69b51bbb03f73e04c486f79d1556b2d9becf4dbc (diff) |
isdn: mISDNinfineon: fix potential NULL pointer dereference
In case ioremap fails, the fix returns -ENOMEM to avoid NULL
pointer dereference.
Signed-off-by: Kangjie Lu <kjlu@umn.edu>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/isdn')
-rw-r--r-- | drivers/isdn/hardware/mISDN/mISDNinfineon.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/drivers/isdn/hardware/mISDN/mISDNinfineon.c b/drivers/isdn/hardware/mISDN/mISDNinfineon.c index 3e01012be4ab..0fe6ddcb3fdc 100644 --- a/drivers/isdn/hardware/mISDN/mISDNinfineon.c +++ b/drivers/isdn/hardware/mISDN/mISDNinfineon.c | |||
@@ -712,8 +712,11 @@ setup_io(struct inf_hw *hw) | |||
712 | (ulong)hw->addr.start, (ulong)hw->addr.size); | 712 | (ulong)hw->addr.start, (ulong)hw->addr.size); |
713 | return err; | 713 | return err; |
714 | } | 714 | } |
715 | if (hw->ci->addr_mode == AM_MEMIO) | 715 | if (hw->ci->addr_mode == AM_MEMIO) { |
716 | hw->addr.p = ioremap(hw->addr.start, hw->addr.size); | 716 | hw->addr.p = ioremap(hw->addr.start, hw->addr.size); |
717 | if (unlikely(!hw->addr.p)) | ||
718 | return -ENOMEM; | ||
719 | } | ||
717 | hw->addr.mode = hw->ci->addr_mode; | 720 | hw->addr.mode = hw->ci->addr_mode; |
718 | if (debug & DEBUG_HW) | 721 | if (debug & DEBUG_HW) |
719 | pr_notice("%s: IO addr %lx (%lu bytes) mode%d\n", | 722 | pr_notice("%s: IO addr %lx (%lu bytes) mode%d\n", |