aboutsummaryrefslogtreecommitdiff
path: root/hw/prd.c
diff options
context:
space:
mode:
authorJeremy Kerr <jk@ozlabs.org>2015-06-17 12:15:09 +0800
committerStewart Smith <stewart@linux.vnet.ibm.com>2015-06-19 07:37:36 +1000
commit0cb7dba2eb6158366fe78db7163fde37638d230b (patch)
treef828ca511c4624dc024de38ad772221a651c57c5 /hw/prd.c
parentc8d15a5d13cea5a7b2d6a6ee634dfd17c83c8c13 (diff)
downloadskiboot-0cb7dba2eb6158366fe78db7163fde37638d230b.zip
skiboot-0cb7dba2eb6158366fe78db7163fde37638d230b.tar.gz
skiboot-0cb7dba2eb6158366fe78db7163fde37638d230b.tar.bz2
hw/prd: Fix handling of invlid message types
If we get a prd_message_consumed callback from the opal_msg interface, and it has an invalid message type, then we'll end up returning with the events_lock held. This really shouldn't happen (as we have handlers for all message types that we queue), but we should still handle this gracefully. This change fixes the error path to log and error and send any further queued messages. Signed-off-by: Jeremy Kerr <jk@ozlabs.org> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
Diffstat (limited to 'hw/prd.c')
-rw-r--r--hw/prd.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/hw/prd.c b/hw/prd.c
index 87babd1..5487be5 100644
--- a/hw/prd.c
+++ b/hw/prd.c
@@ -113,10 +113,12 @@ static void prd_msg_consumed(void *data)
event = EVENT_OCC_RESET;
break;
default:
- return;
+ prlog(PR_ERR, "PRD: invalid msg consumed, type: 0x%x\n",
+ msg->hdr.type);
}
- events[proc] &= ~event;
+ if (event)
+ events[proc] &= ~event;
prd_msg_inuse = false;
send_pending_events();
unlock(&events_lock);