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 <mprivozn@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
This commit is contained in:
Michal Privoznik 2020-12-04 16:04:16 +01:00
parent d4eb2aabca
commit a1310c9644

View File

@ -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)) {