提交 b38a4bd3 编写于 作者: A Alan Cox 提交者: Greg Kroah-Hartman

pcmcia cis: on an out of range CIS read return 0xff, don't just warn

The current code displays warnings but then proceeds to try and reference
the data through the PCMCIA window. Instead return 0xff. This prevents bogus
CIS data sending us off into hyperspace.
Signed-off-by: NAlan Cox <alan@linux.intel.com>
Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
上级 a6c6193a
......@@ -168,9 +168,12 @@ int pcmcia_read_cis_mem(struct pcmcia_socket *s, int attr, u_int addr,
} else {
u_int inc = 1, card_offset, flags;
if (addr > CISTPL_MAX_CIS_SIZE)
if (addr > CISTPL_MAX_CIS_SIZE) {
dev_dbg(&s->dev,
"attempt to read CIS mem at addr %#x", addr);
memset(ptr, 0xff, len);
return -1;
}
flags = MAP_ACTIVE | ((cis_width) ? MAP_16BIT : 0);
if (attr) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册