Home Home > GIT Browse
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJiri Kosina <jkosina@suse.cz>2017-11-24 23:19:38 +0100
committerJiri Kosina <jkosina@suse.cz>2017-11-24 23:19:38 +0100
commite03b0273a99739537d6ecb77f0a6cc8ff702a1ca (patch)
tree8015e2644c268ca350f0bf118996d906553a554d
parentfa3ca52e7820021d9cdde270f8bd799e0b9f1f6b (diff)
parent099910699f53599777e4c8afcf81a8f5731b3d81 (diff)
Merge remote-tracking branch 'origin/users/tonyj/SLE11-SP4/bsc1045205' into SLE11-SP4rpm-3.0.101-108.18
-rw-r--r--kernel/audit_watch.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/kernel/audit_watch.c b/kernel/audit_watch.c
index e683869365d9..4b4b9d5506f5 100644
--- a/kernel/audit_watch.c
+++ b/kernel/audit_watch.c
@@ -471,13 +471,15 @@ void audit_remove_watch_rule(struct audit_krule *krule)
list_del(&krule->rlist);
if (list_empty(&watch->rules)) {
+ /*
+ * audit_remove_watch() drops our reference to 'parent' which
+ * can get freed. Grab our own reference to be safe.
+ */
+ audit_get_parent(parent);
audit_remove_watch(watch);
-
- if (list_empty(&parent->watches)) {
- audit_get_parent(parent);
+ if (list_empty(&parent->watches))
fsnotify_destroy_mark(&parent->mark);
- audit_put_parent(parent);
- }
+ audit_put_parent(parent);
}
}