Skip to content

Commit

Permalink
xen/events: BUG() when we can't allocate our event->irq array.
Browse files Browse the repository at this point in the history
In case we can't allocate we are doomed. We should BUG_ON
instead of trying to dereference it later on.

Acked-by: Ian Campbell <ian.campbell@citrix.com>
[v1: Use BUG_ON instead of BUG]
Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
  • Loading branch information
Konrad Rzeszutek Wilk committed Oct 19, 2011
1 parent a102a9e commit 9d093e2
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions drivers/xen/events.c
Original file line number Diff line number Diff line change
Expand Up @@ -1670,6 +1670,7 @@ void __init xen_init_IRQ(void)

evtchn_to_irq = kcalloc(NR_EVENT_CHANNELS, sizeof(*evtchn_to_irq),
GFP_KERNEL);
BUG_ON(!evtchn_to_irq);
for (i = 0; i < NR_EVENT_CHANNELS; i++)
evtchn_to_irq[i] = -1;

Expand Down

0 comments on commit 9d093e2

Please sign in to comment.