Frees a linked list of imp_recv_msgs in the file,impi_revinf for the function,impi_release. This is done through calling the marco, list_for_each_entry and freeing each message inside the loop of the list by calling ipmi_free_msg on each message in the list and thus freeing all the messages in the list as required for the function,impi_release.
Signed-off-by: Nicholas Krause <[email protected]> --- drivers/char/ipmi/ipmi_devintf.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/drivers/char/ipmi/ipmi_devintf.c b/drivers/char/ipmi/ipmi_devintf.c index ec318bf..6e8729a 100644 --- a/drivers/char/ipmi/ipmi_devintf.c +++ b/drivers/char/ipmi/ipmi_devintf.c @@ -157,14 +157,15 @@ static int ipmi_release(struct inode *inode, struct file *file) { struct ipmi_file_private *priv = file->private_data; int rv; + struct ipmi_recv_msg *release, *next; rv = ipmi_destroy_user(priv->user); if (rv) return rv; - /* FIXME - free the messages in the list. */ - kfree(priv); - + list_for_each_entry_safe(release, next, &priv->recv_msgs, link) { + ipmi_free_recv_msg(release); + } return 0; } -- 2.1.0 ------------------------------------------------------------------------------ Dive into the World of Parallel Programming! The Go Parallel Website, sponsored by Intel and developed in partnership with Slashdot Media, is your hub for all things parallel software development, from weekly thought leadership blogs to news, videos, case studies, tutorials and more. Take a look and join the conversation now. http://goparallel.sourceforge.net _______________________________________________ Openipmi-developer mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/openipmi-developer
