Skip to content

Commit

Permalink
pcmcia: fix ioport size calculation in rsrc_nonstatic
Browse files Browse the repository at this point in the history
Size needs to be calculated after manipulating with the start value.

Reported-by: Komuro <komurojun-mbn@nifty.com>
Signed-off-by: Dominik Brodowski <linux@dominikbrodowski.net>
  • Loading branch information
Dominik Brodowski committed Apr 15, 2010
1 parent b1095af commit 41b97ab
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion drivers/pcmcia/rsrc_nonstatic.c
Original file line number Diff line number Diff line change
Expand Up @@ -810,7 +810,7 @@ static int adjust_memory(struct pcmcia_socket *s, unsigned int action, unsigned
static int adjust_io(struct pcmcia_socket *s, unsigned int action, unsigned long start, unsigned long end)
{
struct socket_data *data = s->resource_data;
unsigned long size = end - start + 1;
unsigned long size;
int ret = 0;

#if defined(CONFIG_X86)
Expand All @@ -820,6 +820,8 @@ static int adjust_io(struct pcmcia_socket *s, unsigned int action, unsigned long
start = 0x100;
#endif

size = end - start + 1;

if (end < start)
return -EINVAL;

Expand Down

0 comments on commit 41b97ab

Please sign in to comment.