Skip to content

Commit

Permalink
hiomap: free ipmi message in callback
Browse files Browse the repository at this point in the history
Otherwise we'd slowly leak memory on each hiomap operation.

Fixes: 529bdca
Tested-by: Andrew Jeffery <andrew@aj.id.au>
Signed-off-by: Stewart Smith <stewart@linux.ibm.com>
  • Loading branch information
stewartsmith committed Oct 26, 2018
1 parent 4b8cc05 commit b6de35b
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions libflash/ipmi-hiomap.c
Original file line number Diff line number Diff line change
Expand Up @@ -117,13 +117,15 @@ 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;
}

if (msg->data[1] != ctx->seq) {
prerror("Unmatched sequence number: wanted %u got %u\n",
ctx->seq, msg->data[1]);
res->cc = IPMI_ERR_UNSPECIFIED;
ipmi_free_msg(msg);
return;
}

Expand Down Expand Up @@ -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)
Expand Down

0 comments on commit b6de35b

Please sign in to comment.