diff options
| author | Christian Krafft <krafft@de.ibm.com> | 2008-02-24 14:03:42 -0500 |
|---|---|---|
| committer | Jean Delvare <khali@hyperion.delvare> | 2008-02-24 14:03:42 -0500 |
| commit | 104cb574feb3033299568483a3f68031f47e0d43 (patch) | |
| tree | 72308d9dd04d42c3f0565f7084d78d607031c46d /drivers/i2c | |
| parent | 9e39ffeff6e54ef65832e4eb58059133f1a8aadf (diff) | |
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: Christian Krafft <krafft@de.ibm.com>
Signed-off-by: Jean Delvare <khali@linux-fr.org>
Diffstat (limited to 'drivers/i2c')
| -rw-r--r-- | drivers/i2c/busses/i2c-pca-isa.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/drivers/i2c/busses/i2c-pca-isa.c b/drivers/i2c/busses/i2c-pca-isa.c index 5161aaf9341b..496ee875eb4f 100644 --- a/drivers/i2c/busses/i2c-pca-isa.c +++ b/drivers/i2c/busses/i2c-pca-isa.c | |||
| @@ -125,6 +125,13 @@ static int __devinit pca_isa_probe(struct device *dev, unsigned int id) | |||
| 125 | 125 | ||
| 126 | dev_info(dev, "i/o base %#08lx. irq %d\n", base, irq); | 126 | dev_info(dev, "i/o base %#08lx. irq %d\n", base, irq); |
| 127 | 127 | ||
| 128 | #ifdef CONFIG_PPC_MERGE | ||
| 129 | if (check_legacy_ioport(base)) { | ||
| 130 | dev_err(dev, "I/O address %#08lx is not available\n", base); | ||
| 131 | goto out; | ||
| 132 | } | ||
| 133 | #endif | ||
| 134 | |||
| 128 | if (!request_region(base, IO_SIZE, "i2c-pca-isa")) { | 135 | if (!request_region(base, IO_SIZE, "i2c-pca-isa")) { |
| 129 | dev_err(dev, "I/O address %#08lx is in use\n", base); | 136 | dev_err(dev, "I/O address %#08lx is in use\n", base); |
| 130 | goto out; | 137 | goto out; |
