linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] hv: use correct order when freeing monitor_pages
@ 2014-05-27 17:16 Radim Krčmář
  2014-05-28  1:20 ` Amos Kong
  2014-05-28  3:23 ` Jason Wang
  0 siblings, 2 replies; 3+ messages in thread
From: Radim Krčmář @ 2014-05-27 17:16 UTC (permalink / raw)
  To: linux-kernel
  Cc: Greg Kroah-Hartman, Jason Wang, stable, K. Y. Srinivasan,
	Haiyang Zhang, devel

We try to free two pages when only one has been allocated.
Cleanup path is unlikely, so I haven't found any trace that would fit,
but I hope that free_pages_prepare() does catch it.

Cc: stable@vger.kernel.org
Signed-off-by: Radim Krčmář <rkrcmar@redhat.com>
---
 Cc'd stable because the worst-case looks hard to debug.
 Btw. the module can't get unloaded after we successfully connect?

 drivers/hv/connection.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/hv/connection.c b/drivers/hv/connection.c
index 7f10c15..e84f452 100644
--- a/drivers/hv/connection.c
+++ b/drivers/hv/connection.c
@@ -224,8 +224,8 @@ cleanup:
 		vmbus_connection.int_page = NULL;
 	}
 
-	free_pages((unsigned long)vmbus_connection.monitor_pages[0], 1);
-	free_pages((unsigned long)vmbus_connection.monitor_pages[1], 1);
+	free_pages((unsigned long)vmbus_connection.monitor_pages[0], 0);
+	free_pages((unsigned long)vmbus_connection.monitor_pages[1], 0);
 	vmbus_connection.monitor_pages[0] = NULL;
 	vmbus_connection.monitor_pages[1] = NULL;
 
-- 
1.9.3


^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2014-05-28  3:23 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-05-27 17:16 [PATCH] hv: use correct order when freeing monitor_pages Radim Krčmář
2014-05-28  1:20 ` Amos Kong
2014-05-28  3:23 ` Jason Wang

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).