aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/xen/xenfs
diff options
context:
space:
mode:
authorDaniel De Graaf <dgdegra@tycho.nsa.gov>2010-12-20 17:56:09 -0500
committerJeremy Fitzhardinge <jeremy.fitzhardinge@citrix.com>2010-12-20 17:56:09 -0500
commit6a5b3beff916a19e7672f8c0330b4f82ed367be2 (patch)
tree74f732476f73c04ea94c6f2e848e25a254ffa724 /drivers/xen/xenfs
parent7808121b9a1e44ef12fecd49fa6c268f27a150fc (diff)
xenbus: Fix memory leak on release
Pending responses were leaked on close. Signed-off-by: Daniel De Graaf <dgdegra@tycho.nsa.gov> Signed-off-by: Jan Beulich <jbeulich@novell.com> Signed-off-by: Jeremy Fitzhardinge <jeremy.fitzhardinge@citrix.com>
Diffstat (limited to 'drivers/xen/xenfs')
-rw-r--r--drivers/xen/xenfs/xenbus.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/drivers/xen/xenfs/xenbus.c b/drivers/xen/xenfs/xenbus.c
index 55791dd1105f..8f6c7d4b3e4d 100644
--- a/drivers/xen/xenfs/xenbus.c
+++ b/drivers/xen/xenfs/xenbus.c
@@ -543,6 +543,7 @@ static int xenbus_file_release(struct inode *inode, struct file *filp)
543 struct xenbus_file_priv *u = filp->private_data; 543 struct xenbus_file_priv *u = filp->private_data;
544 struct xenbus_transaction_holder *trans, *tmp; 544 struct xenbus_transaction_holder *trans, *tmp;
545 struct watch_adapter *watch, *tmp_watch; 545 struct watch_adapter *watch, *tmp_watch;
546 struct read_buffer *rb, *tmp_rb;
546 547
547 /* 548 /*
548 * No need for locking here because there are no other users, 549 * 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 free_watch_adapter(watch); 562 free_watch_adapter(watch);
562 } 563 }
563 564
565 list_for_each_entry_safe(rb, tmp_rb, &u->read_buffers, list) {
566 list_del(&rb->list);
567 kfree(rb);
568 }
564 kfree(u); 569 kfree(u);
565 570
566 return 0; 571 return 0;