summaryrefslogtreecommitdiff
path: root/include/linux/i2o.h
diff options
context:
space:
mode:
authorJeff Garzik <jgarzik@pobox.com>2006-02-09 09:29:00 (GMT)
committerJeff Garzik <jgarzik@pobox.com>2006-02-09 09:29:00 (GMT)
commit9caafa6c8686e319cf4d5f3757b3972c6c522b7c (patch)
treeb38979b835b5d22e681b175d0b98a3c7560d9c59 /include/linux/i2o.h
parent51e9f2ff83df6b1c81c5c44f4486c68ed87aa20e (diff)
parentcac0e8e8bb2e7a086643bdd00c41d900a79bb4fa (diff)
downloadlinux-fsl-qoriq-9caafa6c8686e319cf4d5f3757b3972c6c522b7c.tar.xz
Merge branch 'upstream-fixes'
Diffstat (limited to 'include/linux/i2o.h')
-rw-r--r--include/linux/i2o.h6
1 files changed, 4 insertions, 2 deletions
diff --git a/include/linux/i2o.h b/include/linux/i2o.h
index 9ba8067..5a9d8c5 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;