hv: use correct order when freeing monitor_pages
authorRadim Krčmář <rkrcmar@redhat.com>
Tue, 27 May 2014 17:16:20 +0000 (19:16 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 28 May 2014 20:45:15 +0000 (13:45 -0700)
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>
Reviewed-by: Amos Kong <akong@redhat.com>
Acked-by: Jason Wang <jasowang@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/hv/connection.c

index 7f10c151632acc5730e7840fb482909f090bae6f..e84f4526eb36aaad44e8177febfaabde7efc2e81 100644 (file)
@@ -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;