diff mbox

[10/22] FSP/LEDS: Validate fsp msg allocation

Message ID 20150205083945.12859.97286.stgit@localhost.localdomain
State Accepted
Headers show

Commit Message

Vasant Hegde Feb. 5, 2015, 8:39 a.m. UTC
Validate fsp msg allocation before using.

Signed-off-by: Vasant Hegde <hegdevasant@linux.vnet.ibm.com>
---
 hw/fsp/fsp-leds.c |    2 ++
 1 file changed, 2 insertions(+)
diff mbox

Patch

diff --git a/hw/fsp/fsp-leds.c b/hw/fsp/fsp-leds.c
index 8ad363d..ca39d2f 100644
--- a/hw/fsp/fsp-leds.c
+++ b/hw/fsp/fsp-leds.c
@@ -386,6 +386,8 @@  static int fsp_msg_set_led_state(char *loc_code, bool command, bool state)
 
 	msg = fsp_mkmsg(FSP_CMD_SPCN_PASSTHRU, 4,
 			SPCN_ADDR_MODE_CEC_NODE, cmd_hdr, 0, PSI_DMA_LED_BUF);
+	if (!msg)
+		return rc;
 	/*
 	 * Update the local lists based on the attempted SPCN command to
 	 * set/reset an individual led (CEC or ENCL).