From nobody Mon Feb 9 16:12:57 2026 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=philmd@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=philmd@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1630007437; cv=none; d=zohomail.com; s=zohoarc; b=TdVh7VwB7UGLwAWF1JmOa5QoaLkb33Hu9EyeIpn5v+QhEmYXokBjaJTYWVL3aaYQuyedzRPGYp421XbiEuEw3PXXVmOf+4Oo5EykosoWceYM5nf+M0qvwTj8EZSobcL+wgI/04NW9GUeNznnd/1m5jTfHL0XGDhA/k+Tp1ipr8U= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1630007437; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:MIME-Version:Message-ID:References:Subject:To; bh=CPZfczG2XQrRC55s69h86ljHzGci8wjhwO3c1XD3j8g=; b=ZWi54odOCCHTFMgx2WTTi1wPAIBIkPykcm7R9w+sad33Ot4POXMtp2G/j0H6KmAdwU/cJbea68/EIudi8yT2gPV2J9x8UaJqrRvD4M3f4mB2Eo0Pyz+I0NjBQDvTag7rvo/wlSMTSWmIysd/Bs9r8DaiENekEMjwu056Au+HuV0= 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=philmd@redhat.com; dmarc=pass header.from= (p=none dis=none) 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 1630007437519846.7524105756981; Thu, 26 Aug 2021 12:50:37 -0700 (PDT) Received: from mail-wm1-f71.google.com (mail-wm1-f71.google.com [209.85.128.71]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-401-dU2sNudcMhq3_IuojlNMzA-1; Thu, 26 Aug 2021 15:50:35 -0400 Received: by mail-wm1-f71.google.com with SMTP id p5-20020a7bcc85000000b002e7563efc4cso1133643wma.4 for ; Thu, 26 Aug 2021 12:50:35 -0700 (PDT) Return-Path: Return-Path: Received: from x1w.. (163.red-83-52-55.dynamicip.rima-tde.net. [83.52.55.163]) by smtp.gmail.com with ESMTPSA id o5sm4003844wrw.17.2021.08.26.12.50.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 26 Aug 2021 12:50:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1630007436; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=CPZfczG2XQrRC55s69h86ljHzGci8wjhwO3c1XD3j8g=; b=ep4GcBIbHbypnP1/7OG2YW3sS8ewRRhyfMpLWpfG6wl2F//NLg0urvfofPlt3SAGW8roj1 vkaaqhshyy+UX2tCBP8pv7QL/XJcbCT/qXtK+P/4blLI5wylMwMGPCjdnRUJeMA0p/Uxlc ohoOWE8Qpu7L9x6f42rt07iTc/9ZMVk= X-MC-Unique: dU2sNudcMhq3_IuojlNMzA-1 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=CPZfczG2XQrRC55s69h86ljHzGci8wjhwO3c1XD3j8g=; b=r5b6Hi8IVNu9Y35Vu++9M62mzw3pNOCKpWX+tK9m7IIhX9I/aHWE5DCbFFCJzwv3HR cj7XVmGFVjPQFmTcPwF9wZ+gkaKlwWtxFIEXxXHBDlpU4A80n2AQ0I4YfoavqTP9OuYe QeXNRjQwGgQf6y/gFCGPMF84Md0QAqZUCAAwGw6OcA691xePvyjos3eGdRdVOPf1JAPq HNaDK3tfa1oUHeaKjMxYiSVt6k+bC5n57HuxkbiAH2RpHaohAKRIEOkhbNvTsrAwgn8u 8fjp0zFPNbZOKlmUvAfSFhFZEiq7V7JqPMs4lPYxvRIZCXTPKswqkIL5CtIoTT/mMlLQ 7iCg== X-Gm-Message-State: AOAM530jJTt3N+vQdMY88gWAA/j7at0sZUhfcppBYDPJ+vl0nZoq0ZA4 DxKnHB99QoBFueC5KMawHqhRvk0fzEtgYdUbuE8N0SpwDvPC78oOwzbuOiX/YDaE6PMC5hgklcw ntz5DGPBrbO5PZg== X-Received: by 2002:adf:edcf:: with SMTP id v15mr6037107wro.61.1630007434077; Thu, 26 Aug 2021 12:50:34 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxpPp74nFUTEVaLdtiLUSM5iwa51BcR3IivZ17saErSXnDIEFKbQUjijSVSLzvrnHoZPy7trQ== X-Received: by 2002:adf:edcf:: with SMTP id v15mr6037090wro.61.1630007433858; Thu, 26 Aug 2021 12:50:33 -0700 (PDT) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Hanna Reitz , Klaus Jensen , Kevin Wolf , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , qemu-block@nongnu.org, Fam Zheng , Stefan Hajnoczi , Auger Eric Subject: [PATCH v2 04/11] util/vfio-helpers: Remove unreachable code in qemu_vfio_dma_map() Date: Thu, 26 Aug 2021 21:50:07 +0200 Message-Id: <20210826195014.2180369-5-philmd@redhat.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210826195014.2180369-1-philmd@redhat.com> References: <20210826195014.2180369-1-philmd@redhat.com> MIME-Version: 1.0 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=philmd@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1630007438992100001 qemu_vfio_add_mapping() returns a pointer to an indexed entry in pre-allocated QEMUVFIOState::mappings[], thus can not be NULL. Remove the pointless check. Reviewed-by: Klaus Jensen Signed-off-by: Philippe Mathieu-Daud=C3=A9 --- util/vfio-helpers.c | 4 ---- 1 file changed, 4 deletions(-) diff --git a/util/vfio-helpers.c b/util/vfio-helpers.c index d956866b4e9..e7909222cfd 100644 --- a/util/vfio-helpers.c +++ b/util/vfio-helpers.c @@ -751,10 +751,6 @@ int qemu_vfio_dma_map(QEMUVFIOState *s, void *host, si= ze_t size, } =20 mapping =3D qemu_vfio_add_mapping(s, host, size, index + 1, io= va0); - if (!mapping) { - ret =3D -ENOMEM; - goto out; - } assert(qemu_vfio_verify_mappings(s)); ret =3D qemu_vfio_do_mapping(s, host, size, iova0); if (ret) { --=20 2.31.1