]> git.baikalelectronics.ru Git - kernel.git/commit
apparmor: fix aa_label_asxprint return check
authorTom Rix <trix@redhat.com>
Sun, 13 Feb 2022 21:32:28 +0000 (13:32 -0800)
committerJohn Johansen <john.johansen@canonical.com>
Sat, 9 Jul 2022 22:13:59 +0000 (15:13 -0700)
commit89acceb18809f2f1aa7d49a1170da10c36e8a42c
tree9390bda52a8379926151894528349f26f069be7e
parent9dd699bfe035803c9ca40e3544e61513bd7d68d9
apparmor: fix aa_label_asxprint return check

Clang static analysis reports this issue
label.c:1802:3: warning: 2nd function call argument
  is an uninitialized value
  pr_info("%s", str);
  ^~~~~~~~~~~~~~~~~~

str is set from a successful call to aa_label_asxprint(&str, ...)
On failure a negative value is returned, not a -1.  So change
the check.

Fixes: 12b3105b2fcf ("apparmor: add the base fns() for domain labels")
Signed-off-by: Tom Rix <trix@redhat.com>
Signed-off-by: John Johansen <john.johansen@canonical.com>
security/apparmor/label.c