chiark / gitweb /
bus: properly unmap mapped area
authorLennart Poettering <lennart@poettering.net>
Tue, 28 May 2013 08:04:35 +0000 (17:04 +0900)
committerLennart Poettering <lennart@poettering.net>
Wed, 29 May 2013 08:05:01 +0000 (17:05 +0900)
src/libsystemd-bus/bus-message.c

index 55c2d62..6f2f3e9 100644 (file)
@@ -65,8 +65,8 @@ static void message_free_part(sd_bus_message *m, struct bus_body_part *part) {
                 if (!part->sealed)
                         bus_kernel_push_memfd(m->bus, part->memfd, part->data, part->mapped);
                 else {
-                        if (part->size > 0)
-                                assert_se(munmap(part->data, PAGE_ALIGN(part->size)) == 0);
+                        if (part->mapped > 0)
+                                assert_se(munmap(part->data, part->mapped) == 0);
 
                         close_nointr_nofail(part->memfd);
                 }
@@ -1244,7 +1244,6 @@ static void message_extend_containers(sd_bus_message *m, size_t expand) {
         for (c = m->containers; c < m->containers + m->n_containers; c++)
                 if (c->array_size)
                         *c->array_size += expand;
-
 }
 
 static void *message_extend_body(sd_bus_message *m, size_t align, size_t sz) {