mirror of
https://github.com/systemd/systemd.git
synced 2025-03-08 08:58:27 +03:00
bus: fix assert() on HELLO error-path
Make sure we don't call into any bus_kernel_*() functions before b->is_kernel is set to true. Hard-code the CMD_FREE just like the other helpers do.
This commit is contained in:
parent
ec16945ebf
commit
18ee085c15
@ -815,6 +815,10 @@ fail:
|
||||
}
|
||||
|
||||
int bus_kernel_take_fd(sd_bus *b) {
|
||||
struct kdbus_cmd_free cmd_free = {
|
||||
.size = sizeof(cmd_free),
|
||||
.flags = 0,
|
||||
};
|
||||
struct kdbus_bloom_parameter *bloom = NULL;
|
||||
struct kdbus_cmd_hello *hello;
|
||||
struct kdbus_item_list *items;
|
||||
@ -982,7 +986,8 @@ int bus_kernel_take_fd(sd_bus *b) {
|
||||
return bus_start_running(b);
|
||||
|
||||
fail:
|
||||
(void) bus_kernel_cmd_free(b, hello->offset);
|
||||
cmd_free.offset = hello->offset;
|
||||
(void) ioctl(b->input_fd, KDBUS_CMD_FREE, &cmd_free);
|
||||
return r;
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user