diff options
author | Stewart Smith <stewart@linux.ibm.com> | 2018-10-25 03:15:58 -0500 |
---|---|---|
committer | Stewart Smith <stewart@linux.ibm.com> | 2018-10-31 17:33:34 +1100 |
commit | 4e607093833e5f4c8a9bb1581b887ff6c4d77f6d (patch) | |
tree | 2a746da122f391eaf28f72db13245132037ffb1e | |
parent | c7e090237b9613dd56397f147ad2f68adb17f448 (diff) | |
download | skiboot-4e607093833e5f4c8a9bb1581b887ff6c4d77f6d.zip skiboot-4e607093833e5f4c8a9bb1581b887ff6c4d77f6d.tar.gz skiboot-4e607093833e5f4c8a9bb1581b887ff6c4d77f6d.tar.bz2 |
hiomap: free ipmi message in callback
[ Upstream commit b6de35b6896a7d21a72be79e720eeae2dc620fa2 ]
Otherwise we'd slowly leak memory on each hiomap operation.
Fixes: 529bdca0bc546a7ae3ecbd2c3134b7260072d8b0
Tested-by: Andrew Jeffery <andrew@aj.id.au>
Signed-off-by: Stewart Smith <stewart@linux.ibm.com>
-rw-r--r-- | libflash/ipmi-hiomap.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/libflash/ipmi-hiomap.c b/libflash/ipmi-hiomap.c index d36c5f1..5300dae 100644 --- a/libflash/ipmi-hiomap.c +++ b/libflash/ipmi-hiomap.c @@ -117,6 +117,7 @@ static void ipmi_hiomap_cmd_cb(struct ipmi_msg *msg) if (msg->resp_size < 2) { prerror("Illegal response size: %u\n", msg->resp_size); res->cc = IPMI_ERR_UNSPECIFIED; + ipmi_free_msg(msg); return; } @@ -124,6 +125,7 @@ static void ipmi_hiomap_cmd_cb(struct ipmi_msg *msg) prerror("Unmatched sequence number: wanted %u got %u\n", ctx->seq, msg->data[1]); res->cc = IPMI_ERR_UNSPECIFIED; + ipmi_free_msg(msg); return; } @@ -210,6 +212,7 @@ static void ipmi_hiomap_cmd_cb(struct ipmi_msg *msg) msg->data[0]); break; }; + ipmi_free_msg(msg); } static bool hiomap_get_info(struct ipmi_hiomap *ctx) |