[PATCH 2/2] connection: set initial count when extending counter array
John de la Garza
john at jjdev.com
Sun Nov 2 16:15:25 PST 2014
Signed-off-by: John de la Garza <john at jjdev.com>
---
connection.c | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/connection.c b/connection.c
index ec121d6..c1686c7 100644
--- a/connection.c
+++ b/connection.c
@@ -185,6 +185,7 @@ static int kdbus_conn_queue_user_quota(struct kdbus_conn *conn,
if (user >= conn->msg_users_max) {
unsigned int *users;
unsigned int i;
+ struct kdbus_queue_entry *e;
i = 8 + KDBUS_ALIGN8(user);
users = kcalloc(i, sizeof(unsigned int), GFP_KERNEL);
@@ -196,6 +197,10 @@ static int kdbus_conn_queue_user_quota(struct kdbus_conn *conn,
kfree(conn->msg_users);
conn->msg_users = users;
conn->msg_users_max = i;
+ list_for_each_entry(e, &conn->queue.msg_list, entry) {
+ conn->msg_users[user]++;
+ }
+
}
if (conn->msg_users[user] > KDBUS_CONN_MAX_MSGS_PER_USER)
--
2.1.1
More information about the dbus
mailing list