From nobody Sat May 18 10:30:07 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 216.205.24.124 as permitted sender) client-ip=216.205.24.124; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 216.205.24.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1607095883; cv=none; d=zohomail.com; s=zohoarc; b=UuBMTaqbdCVXC6D2bPz0TKn8oYjYu0OX1dgm1RTJOZUxoW9vU8pqkKMNojvGw+pipPapW7ORMPwbs+TKScGcTKyQ6BHC2hvMMP6A2+JYQTKGnr8BZ7KEURuRmQG5sLuGug1N/Go6rtQEKkKvehY6W9GcdxwjEP5pfHe8Er7OBX4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1607095883; h=Content-Type:Content-Transfer-Encoding:Date:From:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:To; bh=wZzwu+k8x/Jn/FLK60lG5mzVUiY+ndqRd0peth929RM=; b=R/wjT9vfFz10ekUtWv1VnIf6DczYCz1MBWZVuLjBZIprYi/wasLGLBN5MMHQGWPVrNKCOCQPfHV0JtUo4tBD2zWNd9QCyVrlDSpEZ/DBeD6CFvwsM1zvSRTxLiY4wo1yfPd/GO+2JtAZDwYbdZhMhKxgWUPISxFgXYUGS6tzEh4= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 216.205.24.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [216.205.24.124]) by mx.zohomail.com with SMTPS id 1607095883415240.3546127874555; Fri, 4 Dec 2020 07:31:23 -0800 (PST) Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-489-56dnvDayNAa2Cqss6x1stw-1; Fri, 04 Dec 2020 10:31:17 -0500 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id E4225100F358; Fri, 4 Dec 2020 15:31:08 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.20]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 96E266F439; Fri, 4 Dec 2020 15:31:08 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id 21995180954D; Fri, 4 Dec 2020 15:31:08 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 0B4FV6GP000980 for ; Fri, 4 Dec 2020 10:31:06 -0500 Received: by smtp.corp.redhat.com (Postfix) id E1D2A1349A; Fri, 4 Dec 2020 15:31:06 +0000 (UTC) Received: from localhost.localdomain (unknown [10.40.194.49]) by smtp.corp.redhat.com (Postfix) with ESMTP id 62ACF620D7 for ; Fri, 4 Dec 2020 15:31:06 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1607095879; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=wZzwu+k8x/Jn/FLK60lG5mzVUiY+ndqRd0peth929RM=; b=WaNbrttZ4We1ZQuYIx2ZNCsQGEBDLvs/0PYdvmnvgDEjkL3NK6cksGSVmeryuf1BpHRiyn 5tI2B9dqQ6dcTBpBC1zlVkfNJDQE4TtexUjpTIOqWjXXg97gDBmw2EgEarerfGjZvxoXc6 OS4Awjjvd+POs9H+adw1JbWi2t4THHE= X-MC-Unique: 56dnvDayNAa2Cqss6x1stw-1 From: Michal Privoznik To: libvir-list@redhat.com Subject: [PATCH] apparmor: Drop needless check in AppArmorSetMemoryLabel() Date: Fri, 4 Dec 2020 16:31:03 +0100 Message-Id: <8418e35d2f27429fa305f78e2c4a9a6d8b959e57.1607095863.git.mprivozn@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-loop: libvir-list@redhat.com X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=libvir-list-bounces@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" 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 --- src/security/security_apparmor.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/src/security/security_apparmor.c b/src/security/security_appar= mor.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 =3D=3D NULL) - return 0; - switch (mem->model) { case VIR_DOMAIN_MEMORY_MODEL_NVDIMM: if (!virFileExists(mem->nvdimmPath)) { --=20 2.26.2