]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - include/linux/i2o.h
[PATCH] NLM: Fix the NLM_GRANTED callback checks
[linux-2.6-omap-h63xx.git] / include / linux / i2o.h
index 9ba8067966677bca95064140fdc124610b7437d8..5a9d8c5991719d121b25471f79b66fd9b25012b0 100644 (file)
@@ -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;