Commit 3f1255dd authored by Tom Rix's avatar Tom Rix Committed by Yang Yingliang
Browse files

apparmor: fix error check



stable inclusion
from linux-4.19.218
commit 9f3eb0a8a5c401f2c29aa2b3b979bbaae5401190

--------------------------------

[ Upstream commit d108370c ]

clang static analysis reports this representative problem:

label.c:1463:16: warning: Assigned value is garbage or undefined
        label->hname = name;
                     ^ ~~~~

In aa_update_label_name(), this the problem block of code

	if (aa_label_acntsxprint(&name, ...) == -1)
		return res;

On failure, aa_label_acntsxprint() has a more complicated return
that just -1.  So check for a negative return.

It was also noted that the aa_label_acntsxprint() main comment refers
to a nonexistent parameter, so clean up the comment.

Fixes: f1bd9041 ("apparmor: add the base fns() for domain labels")
Signed-off-by: default avatarTom Rix <trix@redhat.com>
Reviewed-by: default avatarNick Desaulniers <ndesaulniers@google.com>
Signed-off-by: default avatarJohn Johansen <john.johansen@canonical.com>
Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
Signed-off-by: default avatarYang Yingliang <yangyingliang@huawei.com>
parent af3fd6a7
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment