Skip to content

Commit 9f4d635

Browse files
kengiterdavem330
authored andcommitted
net: fujitsu: fix a potential NULL pointer dereference
In case ioremap fails, the fix releases the pcmcia window and returns -ENOMEM to avoid the NULL pointer dereference. Signed-off-by: Kangjie Lu <kjlu@umn.edu> Signed-off-by: David S. Miller <davem@davemloft.net>
1 parent eb32cfc commit 9f4d635

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

drivers/net/ethernet/fujitsu/fmvj18x_cs.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -547,6 +547,11 @@ static int fmvj18x_get_hwinfo(struct pcmcia_device *link, u_char *node_id)
547547
return -1;
548548

549549
base = ioremap(link->resource[2]->start, resource_size(link->resource[2]));
550+
if (!base) {
551+
pcmcia_release_window(link, link->resource[2]);
552+
return -ENOMEM;
553+
}
554+
550555
pcmcia_map_mem_page(link, link->resource[2], 0);
551556

552557
/*

0 commit comments

Comments
 (0)