Skip to content

Commit

Permalink
pcmcia: preserve configuration information if request_io fails partly
Browse files Browse the repository at this point in the history
If pcmcia_request_io() only fails partly -- for the second of two
requested resources -- preserve the configuration settings for the
first one.

Signed-off-by: Dominik Brodowski <linux@dominikbrodowski.net>
  • Loading branch information
Dominik Brodowski committed Sep 18, 2010
1 parent 151b6a5 commit 7cdffc8
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions drivers/pcmcia/pcmcia_resource.c
Original file line number Diff line number Diff line change
Expand Up @@ -595,7 +595,13 @@ int pcmcia_request_io(struct pcmcia_device *p_dev)
if (c->io[1].end) {
ret = alloc_io_space(s, &c->io[1], p_dev->io_lines);
if (ret) {
struct resource tmp = c->io[0];
/* release the previously allocated resource */
release_io_space(s, &c->io[0]);
/* but preserve the settings, for they worked... */
c->io[0].end = resource_size(&tmp);
c->io[0].start = tmp.start;
c->io[0].flags = tmp.flags;
goto out;
}
} else
Expand Down

0 comments on commit 7cdffc8

Please sign in to comment.