bus: actually unmap kdbus pool after use
This commit is contained in:
@@ -45,8 +45,6 @@
|
||||
#define KDBUS_ITEM_HEADER_SIZE offsetof(struct kdbus_item, data)
|
||||
#define KDBUS_ITEM_SIZE(s) ALIGN8((s) + KDBUS_ITEM_HEADER_SIZE)
|
||||
|
||||
#define KDBUS_POOL_SIZE (4*1024*1024)
|
||||
|
||||
static int parse_unique_name(const char *s, uint64_t *id) {
|
||||
int r;
|
||||
|
||||
|
||||
@@ -33,6 +33,10 @@
|
||||
* sending vectors */
|
||||
#define MEMFD_MIN_SIZE (32*1024)
|
||||
|
||||
/* The size of the per-connection memory pool that we set up and where
|
||||
* the kernel places our incoming messages */
|
||||
#define KDBUS_POOL_SIZE (16*1024*1024)
|
||||
|
||||
struct memfd_cache {
|
||||
int fd;
|
||||
void *address;
|
||||
|
||||
@@ -26,6 +26,7 @@
|
||||
#include <netdb.h>
|
||||
#include <sys/poll.h>
|
||||
#include <byteswap.h>
|
||||
#include <sys/mman.h>
|
||||
|
||||
#include "util.h"
|
||||
#include "macro.h"
|
||||
@@ -64,6 +65,9 @@ static void bus_free(sd_bus *b) {
|
||||
|
||||
bus_close_fds(b);
|
||||
|
||||
if (b->kdbus_buffer)
|
||||
munmap(b->kdbus_buffer, KDBUS_POOL_SIZE);
|
||||
|
||||
free(b->rbuffer);
|
||||
free(b->unique_name);
|
||||
free(b->auth_buffer);
|
||||
|
||||
Reference in New Issue
Block a user