From patchwork Sat Nov 17 19:51:13 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Radoslaw Biernacki X-Patchwork-Id: 151421 Delivered-To: patch@linaro.org Received: by 2002:a2e:299d:0:0:0:0:0 with SMTP id p29-v6csp869020ljp; Sat, 17 Nov 2018 12:17:14 -0800 (PST) X-Google-Smtp-Source: AJdET5fSqEFO1yVK+RJ7r4eS2XFAl240ZeNtSSSA9G1tRnjFXhOFyP+jVNBWIzRCN+pxgehhWa0A X-Received: by 2002:aed:306c:: with SMTP id 99mr14812660qte.61.1542485834006; Sat, 17 Nov 2018 12:17:14 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1542485834; cv=none; d=google.com; s=arc-20160816; b=UOAKnC6s9nIODMVzqqJrVn5f90BQcqJOyhcF8DCpTVB0+ytEfEhrAkOL8t97XX8USM 0QDBrKn0Iog6l8i4H8dTywd/M/bHmkXOvawF0kObe6J6ZEKXzEiB2FLJzqVa/cbo2Ng3 XhceOSsB9XAMx8kRr31T2i2iN7wJQMogaIL1NkVd0r9YyDUqtaFviS9L8jU82gpF4d7E YzrXrdEe4sQzcKQbLVozd37wVocmEdDdaNbCv8FBC924twRZtWDHwtVEK62XtZ4S6uML Wb+tA9QIBeRZxuuEpcYWW/BX0h47emA0QaFM84MDAWzGjv9vUYk+uX31tyn5XmwaZaDG f3bA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=errors-to:sender:content-transfer-encoding:mime-version :list-subscribe:list-help:list-post:list-archive:list-unsubscribe :list-id:precedence:subject:cc:references:in-reply-to:message-id :date:to:from:dkim-signature:delivered-to; bh=vv9a0ruZJR+f2FzHC3hmeS1yeQ2fhPwZ2C5SR5x6e2c=; b=C8FP8cUP8xKXgQK/C0pBO0JH/Qz9RPDzDFW/faEvDLgCeU2rjZwdmva/nZmx+eOQwg TIKYQi7TX7BCadvw/1ZCeRgDonWZItmRf5rDveckBp4PYY0Q1znOdC/lvdhaykuEMc+o +GDxsqjaTIR9B+xa917FXVwrm1qxNHHzqqoxJkJaHjOceUcxThZYz48DXeBx8e2IGFmm guPZYw1SDLhqiGqME4YqqER3poQ1l0eulaipo/iQxY3jL+8NT28YwsHYYHcRcTGXu7HP KlaSabJ/6x/KASw739ejpssFgGgzSPw1+R0WP+qrB94/M6+Pja9AOX5tMmVyiWoN77xL 4ypQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b="Qy7/M8OY"; spf=pass (google.com: domain of libvir-list-bounces@redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from mx1.redhat.com (mx1.redhat.com. [209.132.183.28]) by mx.google.com with ESMTPS id e35si3466007qve.41.2018.11.17.12.17.13 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 17 Nov 2018 12:17:13 -0800 (PST) Received-SPF: pass (google.com: domain of libvir-list-bounces@redhat.com designates 209.132.183.28 as permitted sender) client-ip=209.132.183.28; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b="Qy7/M8OY"; spf=pass (google.com: domain of libvir-list-bounces@redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org 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 mx1.redhat.com (Postfix) with ESMTPS id 3A62BC057F34; Sat, 17 Nov 2018 20:17:12 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id E925C600C7; Sat, 17 Nov 2018 20:17:11 +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 8199F3F7D0; Sat, 17 Nov 2018 20:17:11 +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 wAHJpR5e029355 for ; Sat, 17 Nov 2018 14:51:27 -0500 Received: by smtp.corp.redhat.com (Postfix) id 6FDA2600C7; Sat, 17 Nov 2018 19:51:27 +0000 (UTC) Delivered-To: libvir-list@redhat.com Received: from mx1.redhat.com (ext-mx15.extmail.prod.ext.phx2.redhat.com [10.5.110.44]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 65EDF600C4 for ; Sat, 17 Nov 2018 19:51:25 +0000 (UTC) Received: from mail-ed1-f66.google.com (mail-ed1-f66.google.com [209.85.208.66]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id D119E308338E for ; Sat, 17 Nov 2018 19:51:23 +0000 (UTC) Received: by mail-ed1-f66.google.com with SMTP id f23so13068222edb.3 for ; Sat, 17 Nov 2018 11:51:23 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=N8DwdroMPmJovv46TwQEeDs2zfJZzOXJ9PxmkNmnvGY=; b=Qy7/M8OYy+cWICMTmCCTBjSMAOWdNVe6087ehHHjeMPYh0IMClzM6nk6hThx+bYw02 9sAt4Okl8TLsYkQZ9YbowIffZrpLGLRQKF7Ug9AW7OaoagAauZhTHDjfslhX5A1UkHmW M71ikS0qufA3hPcBaGLnWM37tN/Xz+UmXCj1c= 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; bh=N8DwdroMPmJovv46TwQEeDs2zfJZzOXJ9PxmkNmnvGY=; b=baF2WzvqiwL4KOQb1Eb1K+2yA6dwg55dri2zcSoE/sxPxKwvm4h7kj4Aj0fMWjs+zn a11PnLwsC/ftnMuehDCLMK58h5khPOScjWtWARYDB9mMddvmRb3nATw3gmvG7FC1+uIx iKC0J/O4o+VtV59xNx16EJL/2fooCTV6THLbiMxWftr1o+ynXnPf8sjaCA0ruhezcpT5 QCDiitKM5eorMVpJaSSb7kz55W0dNuw967RSoZSsCbxdyCmOOuKEbqx5KB4HymExQ23B 2S+R8LHxsI7hz6C1vcmm1YKjCVY5mTQ/yJbDwwo2BCGYjEytE28OxemPASEzctHdyahr xr6w== X-Gm-Message-State: AGRZ1gJHCXToMIJURLWppqbZYxLQnh0r2xh0b4dzc2Pe+qzBWLv2YeyS 7uxlb0Xx/cC25m280ll99+umgc5wYTo= X-Received: by 2002:a17:906:e0cb:: with SMTP id gl11-v6mr5473514ejb.92.1542484282237; Sat, 17 Nov 2018 11:51:22 -0800 (PST) Received: from rad-H81M-S1.semihalf.local (31-172-191-173.noc.fibertech.net.pl. [31.172.191.173]) by smtp.gmail.com with ESMTPSA id s12sm7887633edb.43.2018.11.17.11.51.21 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 17 Nov 2018 11:51:21 -0800 (PST) From: Radoslaw Biernacki To: libvir-list@redhat.com, mprivozn@redhat.com Date: Sat, 17 Nov 2018 20:51:13 +0100 Message-Id: <20181117195113.12544-5-radoslaw.biernacki@linaro.org> In-Reply-To: <20181117195113.12544-1-radoslaw.biernacki@linaro.org> References: <20181110125624.1168-1-radoslaw.biernacki@linaro.org> <20181117195113.12544-1-radoslaw.biernacki@linaro.org> X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.44]); Sat, 17 Nov 2018 19:51:24 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.44]); Sat, 17 Nov 2018 19:51:24 +0000 (UTC) for IP:'209.85.208.66' DOMAIN:'mail-ed1-f66.google.com' HELO:'mail-ed1-f66.google.com' FROM:'radoslaw.biernacki@linaro.org' RCPT:'' X-RedHat-Spam-Score: -0.112 (DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2, SPF_PASS) 209.85.208.66 mail-ed1-f66.google.com 209.85.208.66 mail-ed1-f66.google.com X-Scanned-By: MIMEDefang 2.84 on 10.5.110.44 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-loop: libvir-list@redhat.com Cc: laine@laine.org Subject: [libvirt] [PATCH v2 4/4] util: Fixing invalid error checking from virPCIGetNetname() 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: , MIME-Version: 1.0 Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.32]); Sat, 17 Nov 2018 20:17:12 +0000 (UTC) linkdev is In/Out function parameter as second order reference pointer so requires first order dereference for checking NULLs which can be a result from virPCIGetNetName() Fixes: d6ee56d7237 (util: change virPCIGetNetName() to not return error if device has no net name) Signed-off-by: Radoslaw Biernacki Reviewed-by: Michal Privoznik --- src/util/virhostdev.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -- 2.14.1 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list diff --git a/src/util/virhostdev.c b/src/util/virhostdev.c index 1898f9eeb9..1d9345beda 100644 --- a/src/util/virhostdev.c +++ b/src/util/virhostdev.c @@ -317,7 +317,7 @@ virHostdevNetDevice(virDomainHostdevDefPtr hostdev, if (virPCIGetNetName(sysfs_path, 0, NULL, linkdev) < 0) return -1; - if (!linkdev) { + if (!(*linkdev)) { virReportError(VIR_ERR_INTERNAL_ERROR, _("The device at %s has no network device name"), sysfs_path);