[Skiboot] [PATCH] fsp/ipmi: Fix an illegal memory access

Neelesh Gupta neelegup at linux.vnet.ibm.com
Mon Jul 13 15:06:22 AEST 2015


The patch fixes an illegal access to the memory which has been
freed.

Fixes Coverity defect # 101858

Signed-off-by: Neelesh Gupta <neelegup at linux.vnet.ibm.com>
---
 hw/fsp/fsp-ipmi.c |    3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/hw/fsp/fsp-ipmi.c b/hw/fsp/fsp-ipmi.c
index e5cd6e2..729ff93 100644
--- a/hw/fsp/fsp-ipmi.c
+++ b/hw/fsp/fsp-ipmi.c
@@ -87,13 +87,12 @@ static void fsp_ipmi_req_complete(struct fsp_msg *msg)
 {
 	uint8_t status = (msg->resp->word1 >> 8) & 0xff;
 	uint32_t length = msg->resp->data.words[0];
-	struct fsp_ipmi_msg *fsp_ipmi_msg;
+	struct fsp_ipmi_msg *fsp_ipmi_msg = msg->user_data;
 	struct ipmi_msg *ipmi_msg;
 
 	fsp_freemsg(msg);
 
 	if (status != FSP_STATUS_SUCCESS) {
-		fsp_ipmi_msg = msg->user_data;
 		assert(fsp_ipmi_msg == fsp_ipmi.cur_msg);
 
 		ipmi_msg = &fsp_ipmi_msg->ipmi_msg;



More information about the Skiboot mailing list