mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2025-01-06 13:23:18 +00:00
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>
This commit is contained in:
parent
69b51bbb03
commit
d721fe99f6
@ -712,8 +712,11 @@ setup_io(struct inf_hw *hw)
|
||||
(ulong)hw->addr.start, (ulong)hw->addr.size);
|
||||
return err;
|
||||
}
|
||||
if (hw->ci->addr_mode == AM_MEMIO)
|
||||
if (hw->ci->addr_mode == AM_MEMIO) {
|
||||
hw->addr.p = ioremap(hw->addr.start, hw->addr.size);
|
||||
if (unlikely(!hw->addr.p))
|
||||
return -ENOMEM;
|
||||
}
|
||||
hw->addr.mode = hw->ci->addr_mode;
|
||||
if (debug & DEBUG_HW)
|
||||
pr_notice("%s: IO addr %lx (%lu bytes) mode%d\n",
|
||||
|
Loading…
Reference in New Issue
Block a user