From nobody Thu May 2 07:05:36 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1573738618; cv=none; d=zoho.com; s=zohoarc; b=cUKkd+icVVkNJVgl8tjtK/GbX1bWMO+l2tcMKjDsGoyGc+IWdoHTYsvZrTMtL7oMWgy6iwAe1WfE+M/3YIOCZy13EY58b+bcXzXEeDPOiErjQ8hIqwg714IIKjikpw3dPx5iSm49iYuv+3ahkxMF9smdd9TCPx/xhbLp3oZ8qK4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1573738618; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:To; bh=n0F7GP5OBDnX8bTqVEsag6D95SbKx/q+o2G/jKsVy5k=; b=ZV7yu9XvAeimmiBhjzo2mpYUyfhwivNa7OjENpOzm0/ixfU9rrviISn5TQydIl2dnwnpP1TSHeVNfxpUHFmc3Cw6Dxj+zY9KrCq135vgm0xd3mCqJrlqLQfw4O5VZPtDuwfVdqHAU8foOnAIZo61C5RQtmrR6xTqRDxFOeyvi8k= ARC-Authentication-Results: i=1; mx.zoho.com; dkim=pass; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1573738618919948.3177508771573; Thu, 14 Nov 2019 05:36:58 -0800 (PST) Received: from localhost ([::1]:57600 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iVFIs-00087a-2j for importer@patchew.org; Thu, 14 Nov 2019 08:36:55 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:34436) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iVFH3-0007HU-J1 for qemu-devel@nongnu.org; Thu, 14 Nov 2019 08:35:03 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iVFH2-0006hf-L3 for qemu-devel@nongnu.org; Thu, 14 Nov 2019 08:35:01 -0500 Received: from us-smtp-2.mimecast.com ([207.211.31.81]:20294 helo=us-smtp-delivery-1.mimecast.com) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1iVFH2-0006cy-63 for qemu-devel@nongnu.org; Thu, 14 Nov 2019 08:35:00 -0500 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-93-kO6GKXiDPhORxw0LaRhysA-1; Thu, 14 Nov 2019 08:34:55 -0500 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 8A95F91223 for ; Thu, 14 Nov 2019 13:34:54 +0000 (UTC) Received: from localhost (ovpn-117-54.ams2.redhat.com [10.36.117.54]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 6F2FC5E254; Thu, 14 Nov 2019 13:34:51 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1573738496; 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; bh=n0F7GP5OBDnX8bTqVEsag6D95SbKx/q+o2G/jKsVy5k=; b=eupM13RwjGbeSZFT6+xBRXDFz9T8GsCbsHdi2Vq9tJMqHc2MMN77TzICsmMJFMerAc2g8A BhFIGPtgx7ReNMlP/bP4VhNDTkGIpDiqBWrQs3C9aQhufYnHFY8nPbya41Fh3zSAGKws1r KN8oICiQgMr9PjbgLWQRASap3Nb3/Mc= From: Jens Freimann To: qemu-devel@nongnu.org Subject: [PATCH] vfio: don't ignore return value of migrate_add_blocker Date: Thu, 14 Nov 2019 14:34:49 +0100 Message-Id: <20191114133449.11536-1-jfreimann@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 X-MC-Unique: kO6GKXiDPhORxw0LaRhysA-1 X-Mimecast-Spam-Score: 0 Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 207.211.31.81 X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: alex.williamson@redhat.com Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" When an error occurs in migrate_add_blocker() it sets a negative return value and uses error pointer we pass in. Instead of just looking at the error pointer check for a negative return value and avoid a coverity error because the return value is set but never used. This fixes CID 1407219. Fixes: f045a0104c8c ("vfio: unplug failover primary device before migration") Signed-off-by: Jens Freimann Reviewed-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Stefano Garzarella --- hw/vfio/pci.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/vfio/pci.c b/hw/vfio/pci.c index e6569a7968..ed01774673 100644 --- a/hw/vfio/pci.c +++ b/hw/vfio/pci.c @@ -2737,7 +2737,7 @@ static void vfio_realize(PCIDevice *pdev, Error **err= p) error_setg(&vdev->migration_blocker, "VFIO device doesn't support migration"); ret =3D migrate_add_blocker(vdev->migration_blocker, &err); - if (err) { + if (ret) { error_propagate(errp, err); error_free(vdev->migration_blocker); return; --=20 2.21.0