The AppArmorSetMemoryLabel() is a callback that is called from
qemuSecuritySetMemoryLabel() which never passes NULL as @mem.
Therefore, there is no need to check whether @mem is NULL. Also,
no other driver does that and just dereference it immediately.

Signed-off-by: Michal Privoznik <mpriv...@redhat.com>
---
 src/security/security_apparmor.c | 3 ---
 1 file changed, 3 deletions(-)

diff --git a/src/security/security_apparmor.c b/src/security/security_apparmor.c
index eed66e460f..1b035cce2f 100644
--- a/src/security/security_apparmor.c
+++ b/src/security/security_apparmor.c
@@ -681,9 +681,6 @@ AppArmorSetMemoryLabel(virSecurityManagerPtr mgr,
                        virDomainDefPtr def,
                        virDomainMemoryDefPtr mem)
 {
-    if (mem == NULL)
-        return 0;
-
     switch (mem->model) {
     case VIR_DOMAIN_MEMORY_MODEL_NVDIMM:
         if (!virFileExists(mem->nvdimmPath)) {
-- 
2.26.2

Reply via email to