From: Robin Holt on

Under heavy load conditions, our set of xpc messages may become exhausted.
The code handles this correctly with the exception of the management
code which hits a NULL pointer dereference.

To: Andrew Morton <akpm(a)linux-foundation.org>
Signed-off-by: Robin Holt <holt(a)sgi.com>
Cc: Jack Steiner <steiner(a)sgi.com>
Cc: linux-kernel(a)vger.kernel.org
Cc: linux-mm(a)vger.kernel.org

---

drivers/misc/sgi-xp/xpc_uv.c | 8 +++++---
1 file changed, 5 insertions(+), 3 deletions(-)


Index: pv1000000/drivers/misc/sgi-xp/xpc_uv.c
===================================================================
--- pv1000000.orig/drivers/misc/sgi-xp/xpc_uv.c 2009-11-23 18:41:22.000000000 -0600
+++ pv1000000/drivers/misc/sgi-xp/xpc_uv.c 2009-11-23 18:41:31.000000000 -0600
@@ -948,11 +948,13 @@ xpc_get_fifo_entry_uv(struct xpc_fifo_he
head->first = first->next;
if (head->first == NULL)
head->last = NULL;
+
+ head->n_entries--;
+ BUG_ON(head->n_entries < 0);
+
+ first->next = NULL;
}
- head->n_entries--;
- BUG_ON(head->n_entries < 0);
spin_unlock_irqrestore(&head->lock, irq_flags);
- first->next = NULL;
return first;
}


--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo(a)vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/