]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
xen/events: BUG() when we can't allocate our event->irq array.
authorKonrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Thu, 29 Sep 2011 17:31:21 +0000 (13:31 -0400)
committerKonrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Thu, 29 Sep 2011 18:33:26 +0000 (14:33 -0400)
In case we can't allocate we are doomed. We should BUG_ON
instead of trying to dereference it later on.

Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
drivers/xen/events.c

index 7523719bf8a4aab4dadfeb063151958bff9a0d45..5db04bf1bf588bc0c31ac90f6df357c177fbe15c 100644 (file)
@@ -1670,6 +1670,8 @@ void __init xen_init_IRQ(void)
 
        evtchn_to_irq = kcalloc(NR_EVENT_CHANNELS, sizeof(*evtchn_to_irq),
                                    GFP_KERNEL);
+       if (!evtchn_to_irq)
+               BUG();
        for (i = 0; i < NR_EVENT_CHANNELS; i++)
                evtchn_to_irq[i] = -1;