From nobody Fri May 3 18:27:48 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 205.139.110.61 as permitted sender) client-ip=205.139.110.61; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-1.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 205.139.110.61 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=fail(p=none dis=none) header.from=gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1582533242; cv=none; d=zohomail.com; s=zohoarc; b=BvcLtjT2fCWj94yLxqfSz13Db7kx1cg/dwyMTK2Bl9tMenfuX/gBJhhkgKIhI68dwVKRPJMIXTIs4ymWIoAfuJDMx5J0qXLIt2UgF5r1sEO0qzUxMj7Z4jQ+2QGual03gr586V1C2ayc/qAJjr3z+2Gm4pShelLWnMZckmZ+abk= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1582533242; 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=PTpCKETzRfMoAYhX/elkuGgSbZORSlD+InwVsZDJQmE=; b=fSHwOs2m8jDg8VbqMIUuS5OiqHow2ERdXrNtXbkTIau/BhFNy5B2uABAHDhUZwKx2EHYpJUjRCJqbsWJUByTCymwYWDzVXRqxxNr6zty3vLs1/TvDWfKD08jEGaywvyb7HDzFSt97Wnlulhh473NnM8L6K9Hwp+Mu+jmQH7/zM8= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 205.139.110.61 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from us-smtp-delivery-1.mimecast.com (us-smtp-2.mimecast.com [205.139.110.61]) by mx.zohomail.com with SMTPS id 1582533242199764.6432202100797; Mon, 24 Feb 2020 00:34:02 -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-294-9lwEj1EsPkuMWrHIv4T0Tw-1; Mon, 24 Feb 2020 03:33:59 -0500 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 37B8A800D50; Mon, 24 Feb 2020 08:33:53 +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 B5BD6100E7E3; Mon, 24 Feb 2020 08:33:52 +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 5D5C718089C8; Mon, 24 Feb 2020 08:33:52 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.rdu2.redhat.com [10.11.54.6]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 01MNMwaL030236 for ; Sat, 22 Feb 2020 18:22:58 -0500 Received: by smtp.corp.redhat.com (Postfix) id AE3192166B2E; Sat, 22 Feb 2020 23:22:58 +0000 (UTC) Received: from mimecast-mx02.redhat.com (mimecast01.extmail.prod.ext.rdu2.redhat.com [10.11.55.17]) by smtp.corp.redhat.com (Postfix) with ESMTPS id AA0F22166B2B for ; Sat, 22 Feb 2020 23:22:56 +0000 (UTC) Received: from us-smtp-1.mimecast.com (us-smtp-2.mimecast.com [207.211.31.81]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 1EBFE85A304 for ; Sat, 22 Feb 2020 23:22:56 +0000 (UTC) Received: from mail-lj1-f196.google.com (mail-lj1-f196.google.com [209.85.208.196]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-223-JsK2lgIZPfSPcILyIvI2MA-1; Sat, 22 Feb 2020 18:22:53 -0500 Received: by mail-lj1-f196.google.com with SMTP id x14so5997167ljd.13 for ; Sat, 22 Feb 2020 15:22:52 -0800 (PST) Received: from localhost.localdomain (h-158-174-186-59.NA.cust.bahnhof.se. [158.174.186.59]) by smtp.gmail.com with ESMTPSA id h7sm3708028lfj.29.2020.02.22.15.22.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 22 Feb 2020 15:22:50 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1582533241; h=from:from:sender:sender: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:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=PTpCKETzRfMoAYhX/elkuGgSbZORSlD+InwVsZDJQmE=; b=Ym4vmkztm/EZwQlh30GpqUazHqLEyliT5oD5jct3ioPZjbSlXXSsp5iE9Dowh6/LjL0Ngk /4qqAegQOcULoRVyVNC0CkpYw5VjhJhsmU5udGbJeq9g9K6zjysWk/tHyiOqItWnDCHBhm IKlBkj5bOCmtWdpWm4rI/9bRP1Nbcnk= X-MC-Unique: 9lwEj1EsPkuMWrHIv4T0Tw-1 X-MC-Unique: JsK2lgIZPfSPcILyIvI2MA-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:mime-version :content-transfer-encoding; bh=nXG3O5JwM8FZyJDfiC5vSJ4a8TTi83wYA3FfqOWb/Aw=; b=tPhD78oRHVu1YwILAaFmaorFzRpi9jIEA/UH/3fV4QNJKsjAgezdmLPjjLRvUvNU3o jAnNFHz8QF46Oum8iwigv+YL/5+erMt+ih6KW/S8ZpxP6Z5fAIrP4CzAJ88EXYRkf/pf AuFdX/YE2rVv6n/3n4zggFcAeJlN+Qi16LnEpL0VS2WB9/3pqhPyXAzDInwZ2XSG8T3d QvXRE/ITwlsc0gFj1fZb668gcIW8LF3eYUDf/UDIwmUOnkQB0Pz2zBK2lr0s+aYMK/L/ /jbNTLNjF/h4u44jDqUEG/X2O3RBGPF2qj5r9bCDQffEi+TBDdtsUpVUAuphTNFVfuOj 14lQ== X-Gm-Message-State: APjAAAXrj5iP0f51TlJJmxgx+KncvIYGu6PNHpA506Byif1KfdLY3xNJ 85EVQ6TOdP/89Le9atlZlH8dH7Lz7Fg= X-Google-Smtp-Source: APXvYqwVqPrdVbjUJLLZbqvSfPYo29Ur/2k9canS7r+o14S/mDl3hRX5PJuXzskcM6FwgvDUX08qmQ== X-Received: by 2002:a2e:9f47:: with SMTP id v7mr25967643ljk.124.1582413771302; Sat, 22 Feb 2020 15:22:51 -0800 (PST) From: Rikard Falkeborn To: libvir-list@redhat.com Subject: [libvirt PATCH] vz: Fix return value in error path Date: Sun, 23 Feb 2020 00:22:47 +0100 Message-Id: <20200222232247.192902-1-rikard.falkeborn@gmail.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.78 on 10.11.54.6 X-MIME-Autoconverted: from quoted-printable to 8bit by lists01.pubmisc.prod.ext.phx2.redhat.com id 01MNMwaL030236 X-loop: libvir-list@redhat.com X-Mailman-Approved-At: Mon, 24 Feb 2020 03:33:38 -0500 Cc: Rikard Falkeborn 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.84 on 10.5.11.22 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" If PrlVmDev_GetType(), PrlVmDev_GetIndex() or PrlVmCfg_GetBootDevCount() fails, return false to indicate error. Returning -1 would be interpreted as true when used in an if-statement. Fixes: 8c9252aa6d95247537da0939b54fdd2f31695e32 Signed-off-by: Rikard Falkeborn Reviewed-by: J=C3=A1n Tomko --- src/vz/vz_sdk.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/vz/vz_sdk.c b/src/vz/vz_sdk.c index 877692aeba..2c68c7cb27 100644 --- a/src/vz/vz_sdk.c +++ b/src/vz/vz_sdk.c @@ -1609,13 +1609,13 @@ prlsdkInBootList(PRL_HANDLE sdkdom, size_t i; =20 pret =3D PrlVmDev_GetType(sdktargetdev, &targetType); - prlsdkCheckRetExit(pret, -1); + prlsdkCheckRetExit(pret, false); =20 pret =3D PrlVmDev_GetIndex(sdktargetdev, &targetIndex); - prlsdkCheckRetExit(pret, -1); + prlsdkCheckRetExit(pret, false); =20 pret =3D PrlVmCfg_GetBootDevCount(sdkdom, &bootNum); - prlsdkCheckRetExit(pret, -1); + prlsdkCheckRetExit(pret, false); =20 for (i =3D 0; i < bootNum; ++i) { pret =3D PrlVmCfg_GetBootDev(sdkdom, i, &bootDev); --=20 2.25.1