[03/11] UBUNTU: SAUCE: apparmor: fix reference count bug in label_merge_insert()

Message ID 20170331125744.16986-4-john.johansen@canonical.com
State New
Headers show

Commit Message

John Johansen March 31, 2017, 12:57 p.m.
@new does not have a reference taken locally and should not have its
reference put locally either.

BugLink: http://bugs.launchpad.net/bugs/1660833
Signed-off-by: John Johansen <john.johansen@canonical.com>
Acked-by: Stefan Bader <stefan.bader@canonical.com>
Acked-by: Tim Gardner <tim.gardner@canonical.com>
Acked-by: Brad Figg <brad.figg@canonical.com>
Signed-off-by: Thadeu Lima de Souza Cascardo <cascardo@canonical.com>
---
 security/apparmor/label.c | 1 -
 1 file changed, 1 deletion(-)

Patch

diff --git a/security/apparmor/label.c b/security/apparmor/label.c
index 738fe52..05ac6d6 100644
--- a/security/apparmor/label.c
+++ b/security/apparmor/label.c
@@ -1083,7 +1083,6 @@  static struct aa_label *label_merge_insert(struct aa_label *new,
 		/* TODO: deal with reference labels */
 		if (new->size == 1) {
 			label = aa_get_label(&new->vec[0]->label);
-			aa_put_label(new);
 			return label;
 		}
 	} else if (!stale) {