aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVasant Hegde <hegdevasant@linux.vnet.ibm.com>2014-11-24 10:06:14 +0530
committerStewart Smith <stewart@linux.vnet.ibm.com>2014-11-26 10:31:52 +1100
commit7854b261c98ca419e3f33af969ccc5e74f3b5716 (patch)
tree7215199e2311b8aa8e483d8885e01e46bca61b91
parent82b950bc00a61f0c18634ede0df09fd5fcbc8a59 (diff)
downloadskiboot-7854b261c98ca419e3f33af969ccc5e74f3b5716.zip
skiboot-7854b261c98ca419e3f33af969ccc5e74f3b5716.tar.gz
skiboot-7854b261c98ca419e3f33af969ccc5e74f3b5716.tar.bz2
FSP: Validate fsp_msg in fsp_queue_msg
There are many places where we just pass fsp_msg without validating whether message allocation succeded or not (like fsp_queue_msg(fsp_mkmsg(...))). If message allocation fails then we endup crashing OPAL. This patch validates fsp_msg before using. Signed-off-by: Vasant Hegde <hegdevasant@linux.vnet.ibm.com> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
-rw-r--r--hw/fsp/fsp.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/hw/fsp/fsp.c b/hw/fsp/fsp.c
index 57cba31..8a73f2c 100644
--- a/hw/fsp/fsp.c
+++ b/hw/fsp/fsp.c
@@ -949,7 +949,7 @@ int fsp_queue_msg(struct fsp_msg *msg, void (*comp)(struct fsp_msg *msg))
u16 seq;
int rc = 0;
- if (!fsp)
+ if (!fsp || !msg)
return -1;
/* Recursive locking */