Commit:     104cb574feb3033299568483a3f68031f47e0d43
Parent:     9e39ffeff6e54ef65832e4eb58059133f1a8aadf
Author:     Christian Krafft <[EMAIL PROTECTED]>
AuthorDate: Sun Feb 24 20:03:42 2008 +0100
Committer:  Jean Delvare <[EMAIL PROTECTED]>
CommitDate: Sun Feb 24 20:03:42 2008 +0100

    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 <[EMAIL PROTECTED]>
    Signed-off-by: Jean Delvare <[EMAIL PROTECTED]>
 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 5161aaf..496ee87 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)
        dev_info(dev, "i/o base %#08lx. irq %d\n", base, irq);
+       if (check_legacy_ioport(base)) {
+               dev_err(dev, "I/O address %#08lx is not available\n", base);
+               goto out;
+       }
        if (!request_region(base, IO_SIZE, "i2c-pca-isa")) {
                dev_err(dev, "I/O address %#08lx is in use\n", base);
                goto out;
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at

Reply via email to