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

Vasant Hegde hegdevasant at linux.vnet.ibm.com
Thu Feb 5 19:39:45 AEDT 2015


Validate fsp msg allocation before using.

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

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).



More information about the Skiboot mailing list