fix more leaks in audit_tree.c tag_chunk()

Several leaks in audit_tree didn't get caught by commit
318b6d3d7ddbcad3d6867e630711b8a705d873d7, including the leak on normal
exit in case of multiple rules refering to the same chunk.

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>

authored by

Al Viro and committed by
Linus Torvalds
b4c30aad 6f5d5114

+6 -3
+6 -3
kernel/audit_tree.c
··· 373 373 for (n = 0; n < old->count; n++) { 374 374 if (old->owners[n].owner == tree) { 375 375 spin_unlock(&hash_lock); 376 - put_inotify_watch(watch); 376 + put_inotify_watch(&old->watch); 377 377 return 0; 378 378 } 379 379 } 380 380 spin_unlock(&hash_lock); 381 381 382 382 chunk = alloc_chunk(old->count + 1); 383 - if (!chunk) 383 + if (!chunk) { 384 + put_inotify_watch(&old->watch); 384 385 return -ENOMEM; 386 + } 385 387 386 388 mutex_lock(&inode->inotify_mutex); 387 389 if (inotify_clone_watch(&old->watch, &chunk->watch) < 0) { ··· 427 425 spin_unlock(&hash_lock); 428 426 inotify_evict_watch(&old->watch); 429 427 mutex_unlock(&inode->inotify_mutex); 430 - put_inotify_watch(&old->watch); 428 + put_inotify_watch(&old->watch); /* pair to inotify_find_watch */ 429 + put_inotify_watch(&old->watch); /* and kill it */ 431 430 return 0; 432 431 } 433 432