SDEI: Pop dispatch context only after error checking
authorJeenu Viswambharan <jeenu.viswambharan@arm.com>
Mon, 22 Jan 2018 12:04:13 +0000 (12:04 +0000)
committerJeenu Viswambharan <jeenu.viswambharan@arm.com>
Tue, 27 Feb 2018 13:41:47 +0000 (13:41 +0000)
commit8e3032f921ae62bebbb2bf4c573864313357ee76
tree6de0bd1cfb24f168cc958acdb3928ccaa8972902
parent5ff6da948710361dec294f4b5106978501531caf
SDEI: Pop dispatch context only after error checking

Currently, when the client attempts to do SDEI_EVENT_COMPLETE or
SDEI_EVENT_COMPLETE_AND_RESUME, the dispatcher pops off the outstanding
dispatch context for sanity check. There are however other checks
following this, which could potentially return failure. If that happens,
by popping the context, the dispatcher has inadvertently discarded a
valid context.

This patch fixes this bug by inspecting (not actually popping) the
outstanding context. The context is popped only after all error checks
are completed.

Change-Id: Ie199f6442f871a8177a8247a0c646543bad76d21
Signed-off-by: Jeenu Viswambharan <jeenu.viswambharan@arm.com>
services/std_svc/sdei/sdei_intr_mgmt.c