提交 c28c3583 编写于 作者: M Miloslav Trmac 提交者: Dmitry Torokhov

Input: wistron - do not crash if BIOS does not support interface

offset can never be < 0 because it has type size_t.  The driver
currently oopses on insmod if BIOS does not support the interface,
instead of refusing to load.
Signed-off-by: NMiloslav Trmac <mitr@volny.cz>
Signed-off-by: NDmitry Torokhov <dtor@mail.ru>
上级 ebbac7dd
...@@ -92,11 +92,11 @@ static void call_bios(struct regs *regs) ...@@ -92,11 +92,11 @@ static void call_bios(struct regs *regs)
preempt_enable(); preempt_enable();
} }
static size_t __init locate_wistron_bios(void __iomem *base) static ssize_t __init locate_wistron_bios(void __iomem *base)
{ {
static const unsigned char __initdata signature[] = static const unsigned char __initdata signature[] =
{ 0x42, 0x21, 0x55, 0x30 }; { 0x42, 0x21, 0x55, 0x30 };
size_t offset; ssize_t offset;
for (offset = 0; offset < 0x10000; offset += 0x10) { for (offset = 0; offset < 0x10000; offset += 0x10) {
if (check_signature(base + offset, signature, if (check_signature(base + offset, signature,
...@@ -109,7 +109,7 @@ static size_t __init locate_wistron_bios(void __iomem *base) ...@@ -109,7 +109,7 @@ static size_t __init locate_wistron_bios(void __iomem *base)
static int __init map_bios(void) static int __init map_bios(void)
{ {
void __iomem *base; void __iomem *base;
size_t offset; ssize_t offset;
u32 entry_point; u32 entry_point;
base = ioremap(0xF0000, 0x10000); /* Can't fail */ base = ioremap(0xF0000, 0x10000); /* Can't fail */
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册