Commit 6a5b3bef authored by Daniel De Graaf's avatar Daniel De Graaf Committed by Jeremy Fitzhardinge

xenbus: Fix memory leak on release

Pending responses were leaked on close.
Signed-off-by: default avatarDaniel De Graaf <dgdegra@tycho.nsa.gov>
Signed-off-by: default avatarJan Beulich <jbeulich@novell.com>
Signed-off-by: default avatarJeremy Fitzhardinge <jeremy.fitzhardinge@citrix.com>
parent 7808121b
...@@ -543,6 +543,7 @@ static int xenbus_file_release(struct inode *inode, struct file *filp) ...@@ -543,6 +543,7 @@ static int xenbus_file_release(struct inode *inode, struct file *filp)
struct xenbus_file_priv *u = filp->private_data; struct xenbus_file_priv *u = filp->private_data;
struct xenbus_transaction_holder *trans, *tmp; struct xenbus_transaction_holder *trans, *tmp;
struct watch_adapter *watch, *tmp_watch; struct watch_adapter *watch, *tmp_watch;
struct read_buffer *rb, *tmp_rb;
/* /*
* No need for locking here because there are no other users, * No need for locking here because there are no other users,
...@@ -561,6 +562,10 @@ static int xenbus_file_release(struct inode *inode, struct file *filp) ...@@ -561,6 +562,10 @@ static int xenbus_file_release(struct inode *inode, struct file *filp)
free_watch_adapter(watch); free_watch_adapter(watch);
} }
list_for_each_entry_safe(rb, tmp_rb, &u->read_buffers, list) {
list_del(&rb->list);
kfree(rb);
}
kfree(u); kfree(u);
return 0; return 0;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment