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>
Mon, 14 Feb 2022 03:41:47 +0000 (19:41 -0800)
commit13db6c2acdcda3513445839f035c7142e9761049
tree078956e62edd4b9f8d12536037551cb3243e25cf
parent364bd29902aead91b15e436a6a69221c800113c8
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: f1bd904175e8 ("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