pcmcia: fix ioport size calculation in rsrc_nonstatic

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Linux Kernel Mailing List
Date: Tuesday, April 20, 2010 - 9:59 am

Gitweb:     http://git.kernel.org/linus/41b97ab5050088cd23692d578e7294c7be26109a
Commit:     41b97ab5050088cd23692d578e7294c7be26109a
Parent:     b1095afe6fd6ea4c0d9e75489b955f898d6617d9
Author:     Dominik Brodowski <linux@dominikbrodowski.net>
AuthorDate: Thu Apr 15 19:01:53 2010 +0200
Committer:  Dominik Brodowski <linux@dominikbrodowski.net>
CommitDate: Thu Apr 15 19:01:53 2010 +0200

    pcmcia: fix ioport size calculation in rsrc_nonstatic
    
    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>
---
 drivers/pcmcia/rsrc_nonstatic.c |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)

diff --git a/drivers/pcmcia/rsrc_nonstatic.c b/drivers/pcmcia/rsrc_nonstatic.c
index 1178a82..a6eb7b5 100644
--- a/drivers/pcmcia/rsrc_nonstatic.c
+++ b/drivers/pcmcia/rsrc_nonstatic.c
@@ -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)
@@ -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;
 
--
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
pcmcia: fix ioport size calculation in rsrc_nonstatic, Linux Kernel Mailing ..., (Tue Apr 20, 9:59 am)