aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVasant Hegde <hegdevasant@linux.vnet.ibm.com>2015-03-20 17:36:15 +0530
committerStewart Smith <stewart@linux.vnet.ibm.com>2015-03-26 11:12:19 +1100
commitcfd735d6747bbaa475327f351e1d7f8ddea4c24c (patch)
treec681df09baf2c66e4fbc1a8eac0840846f68a573
parent8e6de40c1302daeb5029b162d131c3fd9eb23e6f (diff)
downloadskiboot-cfd735d6747bbaa475327f351e1d7f8ddea4c24c.zip
skiboot-cfd735d6747bbaa475327f351e1d7f8ddea4c24c.tar.gz
skiboot-cfd735d6747bbaa475327f351e1d7f8ddea4c24c.tar.bz2
FSP/LED: Continue processing LED update request in error path
Presently if fsp_msg_set_led_state() fails then we don't continue processing remaining LED update request...which is not correct. Also free spcn_cmd in one place rather than freeing at every failure block. 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-leds.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/hw/fsp/fsp-leds.c b/hw/fsp/fsp-leds.c
index fde3cff..dd6cacf 100644
--- a/hw/fsp/fsp-leds.c
+++ b/hw/fsp/fsp-leds.c
@@ -375,7 +375,6 @@ static int fsp_msg_set_led_state(struct led_set_cmd *spcn_cmd)
OPAL_INTERNAL_ERROR);
unlock(&led_lock);
- free(spcn_cmd);
return rc;
}
@@ -429,7 +428,6 @@ static int fsp_msg_set_led_state(struct led_set_cmd *spcn_cmd)
msg = fsp_mkmsg(FSP_CMD_SPCN_PASSTHRU, 4,
SPCN_ADDR_MODE_CEC_NODE, cmd_hdr, 0, PSI_DMA_LED_BUF);
if (!msg) {
- free(spcn_cmd);
cmd |= FSP_STATUS_GENERIC_ERROR;
rc = -1;
goto update_fail;
@@ -446,7 +444,6 @@ static int fsp_msg_set_led_state(struct led_set_cmd *spcn_cmd)
if (rc != OPAL_SUCCESS) {
cmd |= FSP_STATUS_GENERIC_ERROR;
fsp_freemsg(msg);
- free(spcn_cmd);
/* Revert LED state update */
update_led_list(spcn_cmd->loc_code, spcn_cmd->ckpt_status,
spcn_cmd->ckpt_excl_bit);
@@ -497,7 +494,12 @@ static int process_led_state_change(void)
spcn_cmd = list_pop(&spcn_cmdq, struct led_set_cmd, link);
unlock(&spcn_cmd_lock);
- fsp_msg_set_led_state(spcn_cmd);
+ rc = fsp_msg_set_led_state(spcn_cmd);
+ if (rc) {
+ free(spcn_cmd);
+ process_led_state_change();
+ }
+
return rc;
}