diff options
author | Markus Lidel <Markus.Lidel@shadowconnect.com> | 2006-02-03 03:04:29 -0800 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2006-02-03 08:32:07 -0800 |
commit | 8b3e09e19932835fb77c63aaf3b1af6117e78871 (patch) | |
tree | d98125db1fe2ee0c82426cac98c954cd62842e88 /include/linux | |
parent | 15d8ec7d08fbb7876e292b42bc92da8d82df7ea9 (diff) |
[PATCH] I2O: fix and workaround for Motorola/Freescale controller
- This controller violates the I2O spec for the I/O registers. The patch
contains a workaround which moves the registers to the proper location.
(originally author: Matthew Starzewski)
- If a message frame is beyond the mapped address range a error is
returned.
Signed-off-by: Markus Lidel <Markus.Lidel@shadowconnect.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'include/linux')
-rw-r--r-- | include/linux/i2o.h | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/include/linux/i2o.h b/include/linux/i2o.h index 9ba80679666..5a9d8c59917 100644 --- a/include/linux/i2o.h +++ b/include/linux/i2o.h @@ -1115,9 +1115,11 @@ static inline struct i2o_message *i2o_msg_get(struct i2o_controller *c) return ERR_PTR(-ENOMEM); mmsg->mfa = readl(c->in_port); - if (mmsg->mfa == I2O_QUEUE_EMPTY) { + if (unlikely(mmsg->mfa >= c->in_queue.len)) { mempool_free(mmsg, c->in_msg.mempool); - return ERR_PTR(-EBUSY); + if(mmsg->mfa == I2O_QUEUE_EMPTY) + return ERR_PTR(-EBUSY); + return ERR_PTR(-EFAULT); } return &mmsg->msg; |