aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/pcmcia
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/pcmcia')
-rw-r--r--drivers/pcmcia/rsrc_nonstatic.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/drivers/pcmcia/rsrc_nonstatic.c b/drivers/pcmcia/rsrc_nonstatic.c
index 19cecb539759..a06881c3b962 100644
--- a/drivers/pcmcia/rsrc_nonstatic.c
+++ b/drivers/pcmcia/rsrc_nonstatic.c
@@ -124,8 +124,10 @@ static int add_interval(struct resource_map *map, u_long base, u_long num)
124 struct resource_map *p, *q; 124 struct resource_map *p, *q;
125 125
126 for (p = map; ; p = p->next) { 126 for (p = map; ; p = p->next) {
127 if ((p != map) && (p->base+p->num-1 >= base)) 127 if ((p != map) && (p->base+p->num >= base)) {
128 return -1; 128 p->num = max(num + base - p->base, p->num);
129 return 0;
130 }
129 if ((p->next == map) || (p->next->base > base+num-1)) 131 if ((p->next == map) || (p->next->base > base+num-1))
130 break; 132 break;
131 } 133 }