aboutsummaryrefslogtreecommitdiff
path: root/hw/occ.c
diff options
context:
space:
mode:
authorVasant Hegde <hegdevasant@linux.vnet.ibm.com>2015-03-08 23:03:19 +0530
committerStewart Smith <stewart@linux.vnet.ibm.com>2015-03-10 14:22:06 +1100
commitffafad50beb7f5a93f5107e48095dfe6d527ac89 (patch)
treec06cce7fce04be892c5718ecff53c8c6be87ec6d /hw/occ.c
parent963685d0a6318f161b27516b360898079c2b216e (diff)
downloadskiboot-ffafad50beb7f5a93f5107e48095dfe6d527ac89.zip
skiboot-ffafad50beb7f5a93f5107e48095dfe6d527ac89.tar.gz
skiboot-ffafad50beb7f5a93f5107e48095dfe6d527ac89.tar.bz2
OCC: Fix possible memory leak in error path
Signed-off-by: Vasant Hegde <hegdevasant@linux.vnet.ibm.com> cc: Neelesh Gupta <neelegup@linux.vnet.ibm.com> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
Diffstat (limited to 'hw/occ.c')
-rw-r--r--hw/occ.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/hw/occ.c b/hw/occ.c
index bd8fbd0..34d6de5 100644
--- a/hw/occ.c
+++ b/hw/occ.c
@@ -409,6 +409,7 @@ static void __occ_do_load(u8 scope, u32 dbob_id __unused, u32 seq_id)
if (rc) {
log_simple_error(&e_info(OPAL_RC_OCC_LOAD),
"OCC: Error %d queueing FSP OCC LOAD STATUS msg", rc);
+ fsp_freemsg(stat);
}
}
@@ -446,6 +447,7 @@ static void occ_do_load(u8 scope, u32 dbob_id __unused, u32 seq_id)
if (rc) {
log_simple_error(&e_info(OPAL_RC_OCC_LOAD),
"OCC: Error %d queueing FSP OCC LOAD reply\n", rc);
+ fsp_freemsg(rsp);
return;
}
@@ -483,6 +485,7 @@ static void occ_do_reset(u8 scope, u32 dbob_id, u32 seq_id)
if (rsp)
rc = fsp_queue_msg(rsp, fsp_freemsg);
if (rc) {
+ fsp_freemsg(rsp);
log_simple_error(&e_info(OPAL_RC_OCC_RESET),
"OCC: Error %d queueing FSP OCC RESET reply\n", rc);
return;
@@ -511,6 +514,7 @@ static void occ_do_reset(u8 scope, u32 dbob_id, u32 seq_id)
if (stat)
rc = fsp_queue_msg(stat, fsp_freemsg);
if (rc) {
+ fsp_freemsg(stat);
log_simple_error(&e_info(OPAL_RC_OCC_RESET),
"OCC: Error %d queueing FSP OCC RESET"
" STATUS message\n", rc);
@@ -530,6 +534,7 @@ static void occ_do_reset(u8 scope, u32 dbob_id, u32 seq_id)
if (stat)
rc = fsp_queue_msg(stat, fsp_freemsg);
if (rc) {
+ fsp_freemsg(stat);
log_simple_error(&e_info(OPAL_RC_OCC_RESET),
"OCC: Error %d queueing FSP OCC RESET"
" STATUS message\n", rc);