Skip to content

Commit d721fe9

Browse files
kengiterdavem330
authored andcommitted
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 <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent 69b51bb commit d721fe9

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

drivers/isdn/hardware/mISDN/mISDNinfineon.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -712,8 +712,11 @@ setup_io(struct inf_hw *hw)
712712
(ulong)hw->addr.start, (ulong)hw->addr.size);
713713
return err;
714714
}
715-
if (hw->ci->addr_mode == AM_MEMIO)
715+
if (hw->ci->addr_mode == AM_MEMIO) {
716716
hw->addr.p = ioremap(hw->addr.start, hw->addr.size);
717+
if (unlikely(!hw->addr.p))
718+
return -ENOMEM;
719+
}
717720
hw->addr.mode = hw->ci->addr_mode;
718721
if (debug & DEBUG_HW)
719722
pr_notice("%s: IO addr %lx (%lu bytes) mode%d\n",

0 commit comments

Comments
 (0)