]> git.baikalelectronics.ru Git - kernel.git/commit
xen/event: validate irq before get evtchn by irq
authorJoe Jin <joe.jin@oracle.com>
Fri, 7 Jan 2011 06:50:12 +0000 (14:50 +0800)
committerKonrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Mon, 10 Jan 2011 15:46:32 +0000 (10:46 -0500)
commit876af92fd66330a618c9303dc986d5c046986c7d
tree9c489bc508c244fb43d97fd79a1618281845d91c
parentce241f6ade67e3f476a658aeb78315cec465b287
xen/event: validate irq before get evtchn by irq

When retrieving the event channel number from irq, the irq
number may not be valid under some conditions.

So far that can be when we suspend/resume and irq ends with -1.
Validate and return sanitized irq and provide diagnostics information.

[v3: added unlikely on the WARN path]
[v2: reworded the commit message]
Signed-off-by: Joe Jin <joe.jin@oracle.com>
Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Tested-by: Gurudas Pai <gurudas.pai@oracle.com>
Cc: Ian Campbell <ian.campbell@citrix.com>
Cc: Jeremy Fitzhardinge <jeremy@goop.org>
Cc: Andrew Morton <akpm@linux-foundation.org>
drivers/xen/events.c