提交 41d1b3e8 编写于 作者: J John Johansen

apparmor: Fix smatch warning in aa_remove_profiles

smatch reports
  error: potential NULL dereference 'ns'.

this can not actually occur because it relies on aa_split_fqname setting
both ns_name and name as null but ns_name will actually always have a
value in this case.

so remove the unnecessary if (ns_name) conditional that is resulting
in the false positive further down.
Signed-off-by: NJohn Johansen <john.johansen@canonical.com>
上级 b492d50b
......@@ -1156,14 +1156,12 @@ ssize_t aa_remove_profiles(char *fqname, size_t size)
if (fqname[0] == ':') {
char *ns_name;
name = aa_split_fqname(fqname, &ns_name);
if (ns_name) {
/* released below */
ns = aa_find_namespace(root, ns_name);
if (!ns) {
info = "namespace does not exist";
error = -ENOENT;
goto fail;
}
/* released below */
ns = aa_find_namespace(root, ns_name);
if (!ns) {
info = "namespace does not exist";
error = -ENOENT;
goto fail;
}
} else
/* released below */
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册