Signed-off-by: Ryan Lee <[email protected]>
---
 security/apparmor/task.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/security/apparmor/task.c b/security/apparmor/task.c
index b9fb3738124e..4c6112ba63b7 100644
--- a/security/apparmor/task.c
+++ b/security/apparmor/task.c
@@ -64,9 +64,10 @@ int aa_replace_current_label(struct aa_label *label)
 
        if (ctx->nnp && label_is_stale(ctx->nnp)) {
                struct aa_label *tmp = ctx->nnp;
+               bool needput;
 
-               ctx->nnp = aa_get_newest_label(tmp);
-               aa_put_label(tmp);
+               ctx->nnp = aa_get_newest_label_condref(tmp, &needput);
+               aa_put_label_condref(tmp, needput);
        }
        if (unconfined(label) || (labels_ns(old) != labels_ns(label)))
                /*
-- 
2.43.0


Reply via email to