From: Michal Privoznik Date: Fri, 4 Dec 2020 15:04:16 +0000 (+0100) Subject: apparmor: Drop needless check in AppArmorSetMemoryLabel() X-Git-Tag: v7.0.0-rc1~303 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=a1310c96441996eb0381a68b0e294790805a6231;p=thirdparty%2Flibvirt.git apparmor: Drop needless check in AppArmorSetMemoryLabel() 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 Reviewed-by: Peter Krempa --- 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)) {