提交 41b97ab5 编写于 作者: D Dominik Brodowski

pcmcia: fix ioport size calculation in rsrc_nonstatic

Size needs to be calculated after manipulating with the start value.
Reported-by: NKomuro <komurojun-mbn@nifty.com>
Signed-off-by: NDominik Brodowski <linux@dominikbrodowski.net>
上级 b1095afe
......@@ -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;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册