Commit b43d4d87 authored by Rusty Russell's avatar Rusty Russell Committed by Linus Torvalds

[PATCH] Remove racy check_mem_region() call from pcbit_drv.c

From:  Bob Miller <rem@osdl.org>

  Removed the check_mem_region() call and replaced with request_mem_region().
parent 9d6f368c
......@@ -87,15 +87,13 @@ int pcbit_init_dev(int board, int mem_base, int irq)
if (mem_base >= 0xA0000 && mem_base <= 0xFFFFF ) {
dev->ph_mem = mem_base;
if (check_mem_region(dev->ph_mem, 4096)) {
if (!request_mem_region(dev->ph_mem, 4096, "PCBIT mem")) {
printk(KERN_WARNING
"PCBIT: memory region %lx-%lx already in use\n",
dev->ph_mem, dev->ph_mem + 4096);
kfree(dev);
dev_pcbit[board] = NULL;
return -EACCES;
} else {
request_mem_region(dev->ph_mem, 4096, "PCBIT mem");
}
dev->sh_mem = (unsigned char*)ioremap(dev->ph_mem, 4096);
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment