Commit 8e738242 authored by Kay Sievers's avatar Kay Sievers

bus: align the buffer we pass to the kernel

parent 1b9abbf0
......@@ -109,7 +109,7 @@ static int bus_message_setup_kmsg(sd_bus_message *m) {
sz += ALIGN8(offsetof(struct kdbus_msg, data) + dl + 1);
}
m->kdbus = malloc0(sz);
m->kdbus = aligned_alloc(8, sz);
if (!m->kdbus)
return -ENOMEM;
......@@ -355,10 +355,11 @@ int bus_kernel_read_message(sd_bus *bus, sd_bus_message **m) {
for (;;) {
void *q;
q = realloc(bus->rbuffer, sz);
q = aligned_alloc(8, sz);
if (!q)
return -errno;
free(bus->rbuffer);
k = bus->rbuffer = q;
k->size = sz;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment