提交 104cb574 编写于 作者: C Christian Krafft 提交者: Jean Delvare

i2c-pca-isa: Add access check to legacy ioports

When probing i2c-pca-isa writes to legacy ioports, which crashes the kernel
if there is no device at that port.
This patch adds a check_legacy_ioport call, so probe fails gracefully
and thus prevents the oops.
Signed-off-by: NChristian Krafft <krafft@de.ibm.com>
Signed-off-by: NJean Delvare <khali@linux-fr.org>
上级 9e39ffef
......@@ -125,6 +125,13 @@ static int __devinit pca_isa_probe(struct device *dev, unsigned int id)
dev_info(dev, "i/o base %#08lx. irq %d\n", base, irq);
#ifdef CONFIG_PPC_MERGE
if (check_legacy_ioport(base)) {
dev_err(dev, "I/O address %#08lx is not available\n", base);
goto out;
}
#endif
if (!request_region(base, IO_SIZE, "i2c-pca-isa")) {
dev_err(dev, "I/O address %#08lx is in use\n", base);
goto out;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册