Skip to contentSkip to conversation

[PATCH linux-2.6.18/xenbus: Fix memory leak on release

PATCH Jan Beulich 1 participant 1 message Dec 20, 2010 Xen hypervisor interface

lore
Share & tools
lore
#0 lore raw

From: Daniel De Graaf <[email protected]>

Pending responses were leaked on close.

drivers/xen/xenbus/xenbus_dev.c +5 -0
@@ -359,6 +359,7 @@ static int xenbus_dev_release(struct ino
 	struct xenbus_dev_data *u = filp->private_data;
 	struct xenbus_dev_transaction *trans, *tmp;
 	struct watch_adapter *watch, *tmp_watch;
+	struct read_buffer *rb, *tmp_rb;
 
 	list_for_each_entry_safe(trans, tmp, &u->transactions, list) {
 		xenbus_transaction_end(trans->handle, 1);
@@ -372,6 +373,10 @@ static int xenbus_dev_release(struct ino
 		free_watch_adapter(watch);
 	}
 
+	list_for_each_entry_safe(rb, tmp_rb, &u->read_buffers, list) {
+		list_del(&rb->list);
+		kfree(rb);
+	}
 	kfree(u);
 
 	return 0;

From: Daniel De Graaf <[email protected]>
Subject: xenbus: Fix memory leak on release

Pending responses were leaked on close.

drivers/xen/xenbus/xenbus_dev.c +5 -0
@@ -359,6 +359,7 @@ static int xenbus_dev_release(struct ino
 	struct xenbus_dev_data *u = filp->private_data;
 	struct xenbus_dev_transaction *trans, *tmp;
 	struct watch_adapter *watch, *tmp_watch;
+	struct read_buffer *rb, *tmp_rb;
 
 	list_for_each_entry_safe(trans, tmp, &u->transactions, list) {
 		xenbus_transaction_end(trans->handle, 1);
@@ -372,6 +373,10 @@ static int xenbus_dev_release(struct ino
 		free_watch_adapter(watch);
 	}
 
+	list_for_each_entry_safe(rb, tmp_rb, &u->read_buffers, list) {
+		list_del(&rb->list);
+		kfree(rb);
+	}
 	kfree(u);
 
 	return 0;

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xensource.com/xen-devel