From 7854b261c98ca419e3f33af969ccc5e74f3b5716 Mon Sep 17 00:00:00 2001 From: Vasant Hegde Date: Mon, 24 Nov 2014 10:06:14 +0530 Subject: 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 Signed-off-by: Stewart Smith --- hw/fsp/fsp.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 */ -- cgit v1.1