mirror of
https://github.com/torvalds/linux.git
synced 2024-11-26 22:21:42 +00:00
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>
This commit is contained in:
parent
eb32cfcdef
commit
9f4d6358e1
@ -547,6 +547,11 @@ static int fmvj18x_get_hwinfo(struct pcmcia_device *link, u_char *node_id)
|
||||
return -1;
|
||||
|
||||
base = ioremap(link->resource[2]->start, resource_size(link->resource[2]));
|
||||
if (!base) {
|
||||
pcmcia_release_window(link, link->resource[2]);
|
||||
return -ENOMEM;
|
||||
}
|
||||
|
||||
pcmcia_map_mem_page(link, link->resource[2], 0);
|
||||
|
||||
/*
|
||||
|
Loading…
Reference in New Issue
Block a user