Skip to content

Commit

Permalink
pcmcia: allow for extension of resource interval
Browse files Browse the repository at this point in the history
If a new interval overlaps or extends an existing interval in
add_interval(), do not fail, but extend the existing interval.

Signed-off-by: Dominik Brodowski <[email protected]>
  • Loading branch information
Dominik Brodowski committed Feb 17, 2010
1 parent d801c14 commit f309cb3
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions drivers/pcmcia/rsrc_nonstatic.c
Original file line number Diff line number Diff line change
Expand Up @@ -124,8 +124,10 @@ static int add_interval(struct resource_map *map, u_long base, u_long num)
struct resource_map *p, *q;

for (p = map; ; p = p->next) {
if ((p != map) && (p->base+p->num-1 >= base))
return -1;
if ((p != map) && (p->base+p->num >= base)) {
p->num = max(num + base - p->base, p->num);
return 0;
}
if ((p->next == map) || (p->next->base > base+num-1))
break;
}
Expand Down

0 comments on commit f309cb3

Please sign in to comment.