summaryrefslogtreecommitdiffstats
path: root/hw/fsp/fsp-mem-err.c
diff options
context:
space:
mode:
authorNeelesh Gupta <neelegup@linux.vnet.ibm.com>2015-06-24 23:19:47 +0530
committerStewart Smith <stewart@linux.vnet.ibm.com>2015-07-10 14:39:53 +1000
commit53c4974b1fc6add1489ddd58d0a938c84ade4c2a (patch)
tree753a2e70d0a42a3faac6879cc8e0cd1d145683da /hw/fsp/fsp-mem-err.c
parent550633437ffd0a2629d398493c8bbac51d3aa490 (diff)
downloadblackbird-skiboot-53c4974b1fc6add1489ddd58d0a938c84ade4c2a.tar.gz
blackbird-skiboot-53c4974b1fc6add1489ddd58d0a938c84ade4c2a.zip
fsp/mem-err: Fix leak in one error path and minor clean ups
Signed-off-by: Neelesh Gupta <neelegup@linux.vnet.ibm.com> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
Diffstat (limited to 'hw/fsp/fsp-mem-err.c')
-rw-r--r--hw/fsp/fsp-mem-err.c14
1 files changed, 4 insertions, 10 deletions
diff --git a/hw/fsp/fsp-mem-err.c b/hw/fsp/fsp-mem-err.c
index 9c42aeec..3eaa1a39 100644
--- a/hw/fsp/fsp-mem-err.c
+++ b/hw/fsp/fsp-mem-err.c
@@ -28,9 +28,6 @@
/* maximum number of error event to hold until linux consumes it. */
#define MERR_MAX_RECORD 1024
-/* FSP response status */
-#define FSP_RESP_STATUS_GENERIC_FAILURE 0xfe
-
struct fsp_mem_err_node {
struct list_node list;
struct OpalMemoryErrorData data;
@@ -68,6 +65,7 @@ static bool send_response_to_fsp(u32 cmd_sub_mod)
if (rsp)
rc = fsp_queue_msg(rsp, fsp_freemsg);
if (rc) {
+ fsp_freemsg(rsp);
/* XXX Generate error logs */
prerror("Error %d queueing FSP memory error reply\n", rc);
return false;
@@ -193,20 +191,16 @@ static bool is_resilience_event_exist(u64 paddr)
static bool handle_memory_resilience(u32 cmd_sub_mod, u64 paddr)
{
int rc = 0;
- u8 err = 0;
struct OpalMemoryErrorData mem_err_evt;
memset(&mem_err_evt, 0, sizeof(struct OpalMemoryErrorData));
/* Check arguments */
if (paddr == 0) {
prerror("memory resilience: Invalid real address.\n");
- err = FSP_RESP_STATUS_GENERIC_FAILURE;
+ return send_response_to_fsp(FSP_RSP_MEM_RES |
+ FSP_STATUS_GENERIC_ERROR);
}
- /* If we had an error, send response to fsp and return */
- if (err)
- return send_response_to_fsp(FSP_RSP_MEM_RES | err);
-
/* Check if event already exist for same address. */
if (is_resilience_event_exist(paddr))
goto send_response;
@@ -302,7 +296,7 @@ static bool handle_memory_deallocation(u64 paddr_start, u64 paddr_end)
if ((paddr_start == 0) || (paddr_end == 0)) {
prerror("memory deallocation: Invalid "
"starting/ending real address.\n");
- err = FSP_RESP_STATUS_GENERIC_FAILURE;
+ err = FSP_STATUS_GENERIC_ERROR;
}
/* If we had an error, send response to fsp and return */
OpenPOWER on IntegriCloud