match: init list rule so we can remove it on error
authorRui Miguel Silva <rmfrfs@gmail.com>
Wed, 17 Dec 2014 15:45:47 +0000 (15:45 +0000)
committerDaniel Mack <daniel@zonque.org>
Wed, 17 Dec 2014 15:59:26 +0000 (16:59 +0100)
initialise the rules_entry so we don't oops on error paths when the rule is not
in list yet.

Signed-off-by: Rui Miguel Silva <rmfrfs@gmail.com>
match.c

diff --git a/match.c b/match.c
index 46a429bec8c07e84d9be4087c40f5339352dbf04..cac414e817b41ae77a986cece060527889edc9dc 100644 (file)
--- a/match.c
+++ b/match.c
@@ -393,6 +393,7 @@ int kdbus_match_db_add(struct kdbus_conn *conn,
                }
 
                rule->type = item->type;
+               INIT_LIST_HEAD(&rule->rules_entry);
 
                switch (item->type) {
                /* First matches for userspace messages */