diff options
-rw-r--r-- | kernel/auditfilter.c | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/kernel/auditfilter.c b/kernel/auditfilter.c index ce61f423542c..1bf093dcffe0 100644 --- a/kernel/auditfilter.c +++ b/kernel/auditfilter.c | |||
@@ -1210,8 +1210,8 @@ static inline int audit_add_rule(struct audit_entry *entry, | |||
1210 | struct audit_entry *e; | 1210 | struct audit_entry *e; |
1211 | struct audit_field *inode_f = entry->rule.inode_f; | 1211 | struct audit_field *inode_f = entry->rule.inode_f; |
1212 | struct audit_watch *watch = entry->rule.watch; | 1212 | struct audit_watch *watch = entry->rule.watch; |
1213 | struct nameidata *ndp, *ndw; | 1213 | struct nameidata *ndp = NULL, *ndw = NULL; |
1214 | int h, err, putnd_needed = 0; | 1214 | int h, err; |
1215 | #ifdef CONFIG_AUDITSYSCALL | 1215 | #ifdef CONFIG_AUDITSYSCALL |
1216 | int dont_count = 0; | 1216 | int dont_count = 0; |
1217 | 1217 | ||
@@ -1239,7 +1239,6 @@ static inline int audit_add_rule(struct audit_entry *entry, | |||
1239 | err = audit_get_nd(watch->path, &ndp, &ndw); | 1239 | err = audit_get_nd(watch->path, &ndp, &ndw); |
1240 | if (err) | 1240 | if (err) |
1241 | goto error; | 1241 | goto error; |
1242 | putnd_needed = 1; | ||
1243 | } | 1242 | } |
1244 | 1243 | ||
1245 | mutex_lock(&audit_filter_mutex); | 1244 | mutex_lock(&audit_filter_mutex); |
@@ -1269,14 +1268,11 @@ static inline int audit_add_rule(struct audit_entry *entry, | |||
1269 | #endif | 1268 | #endif |
1270 | mutex_unlock(&audit_filter_mutex); | 1269 | mutex_unlock(&audit_filter_mutex); |
1271 | 1270 | ||
1272 | if (putnd_needed) | 1271 | audit_put_nd(ndp, ndw); /* NULL args OK */ |
1273 | audit_put_nd(ndp, ndw); | ||
1274 | |||
1275 | return 0; | 1272 | return 0; |
1276 | 1273 | ||
1277 | error: | 1274 | error: |
1278 | if (putnd_needed) | 1275 | audit_put_nd(ndp, ndw); /* NULL args OK */ |
1279 | audit_put_nd(ndp, ndw); | ||
1280 | if (watch) | 1276 | if (watch) |
1281 | audit_put_watch(watch); /* tmp watch, matches initial get */ | 1277 | audit_put_watch(watch); /* tmp watch, matches initial get */ |
1282 | return err; | 1278 | return err; |