From patchwork Tue Jan 22 19:26:15 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: dann frazier X-Patchwork-Id: 156318 Delivered-To: patch@linaro.org Received: by 2002:a02:48:0:0:0:0:0 with SMTP id 69csp7965024jaa; Tue, 22 Jan 2019 11:36:03 -0800 (PST) X-Google-Smtp-Source: ALg8bN4mHfvJC+Wt7leXyBXsEgRBewETeDjnO4fLbQTxjewGYfZ0kJg1dVmVxe3SMbYNfOiflhs9 X-Received: by 2002:ac8:3fc9:: with SMTP id v9mr32307288qtk.108.1548185763712; Tue, 22 Jan 2019 11:36:03 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1548185763; cv=none; d=google.com; s=arc-20160816; b=tci+VcVcZ+alwj/uEbzXim0nF0nyK9bYHgvND/wBOIfiu2QIAsw1CAV6DOgeTvqOgC Ya2/BCBbV5XA0kaC+bMeY05y9dyArMc1l3p7AAdF7Hex+RUpBIthC2jJy0c/UBBSNdLi WgNy3LAMO0Uj3uZYLRyC+SUvRaNMRdF1pc1atb14P3Nh7RAG/1xTbwcP19yZ7lhjnPo8 nf9v5qBAZxvXklKzAtFKtscmormATthwac/Kl84Kmk42aGKXJMwRYRothyeZPAn1/UZf GrZ9M7D3x3FNCVXgmPI02K6T5xFWciKBqBzgV1dF0Uulz5J+DHVDnzv0Pq2QvbdkNGIM 0cEA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=errors-to:sender:content-transfer-encoding:list-subscribe:list-help :list-post:list-archive:list-unsubscribe:list-id:precedence:subject :cc:mime-version:references:in-reply-to:message-id:date:to:from :delivered-to; bh=3Wn8UbZdu+9AMx2D35JdAikH8kj9J60B57wvSXA3Miw=; b=kgb98G1jTf7Rr1jnfaZBvCAyFWA1d4Ph2WZZ8C8t3S4ZKCCYYk0ZJGuwPCLxJB/6+G BF2p++sy35eMEpjxAbgWXoLBiLc0ZEDbweSRYIM+oNzkAvqMItp1dpyxk3dGlC4aJr/D sJfc5LO0C6yyBZpxQ1HNrXtSQGesWHMNVG5g/UsBM9ogHFFbRvqTPHKs/WB4vVTvOCmg YYOU2VM9m1fMsGi06rhBToEIyqNWVH/idyi6Me3F9uAdcnllGjz3tBupK92hXqKGl5hO g+3h+g+q9eczHgezIygaSAVhhjMdzk4z8eYWQKKJ8B2TPA8W6ciRrIkKL9Hye29iPSa0 1GLA== ARC-Authentication-Results: i=1; mx.google.com; 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=canonical.com Return-Path: Received: from mx1.redhat.com (mx1.redhat.com. [209.132.183.28]) by mx.google.com with ESMTPS id f24si1785294qvd.54.2019.01.22.11.36.03 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 22 Jan 2019 11:36:03 -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; 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=canonical.com 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 mx1.redhat.com (Postfix) with ESMTPS id A91C3A789F; Tue, 22 Jan 2019 19:36:01 +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 13EF26A6B3; Tue, 22 Jan 2019 19:36:01 +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 752793F604; Tue, 22 Jan 2019 19:35:57 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id x0MJZugK024858 for ; Tue, 22 Jan 2019 14:35:56 -0500 Received: by smtp.corp.redhat.com (Postfix) id 1C2816A6B3; Tue, 22 Jan 2019 19:35:56 +0000 (UTC) Delivered-To: libvir-list@redhat.com Received: from mx1.redhat.com (ext-mx04.extmail.prod.ext.phx2.redhat.com [10.5.110.28]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 118615D9C7; Tue, 22 Jan 2019 19:35:53 +0000 (UTC) Received: from complete.lackof.org (complete.lackof.org [198.49.126.79]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 3E71E8B104; Tue, 22 Jan 2019 19:35:51 +0000 (UTC) Received: from localhost (c-107-2-141-103.hsd1.co.comcast.net [107.2.141.103]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by complete.lackof.org (Postfix) with ESMTPSA id 428B333E0256; Tue, 22 Jan 2019 12:26:36 -0700 (MST) From: dann frazier To: libvir-list@redhat.com, Radoslaw Biernacki , Michal Privoznik Date: Tue, 22 Jan 2019 12:26:15 -0700 Message-Id: <20190122192615.9256-5-dann.frazier@canonical.com> In-Reply-To: <20190122192615.9256-1-dann.frazier@canonical.com> References: <20190122192615.9256-1-dann.frazier@canonical.com> MIME-Version: 1.0 X-Virus-Scanned: clamav-milter 0.100.2 at complete.lackof.org X-Virus-Status: Clean X-Spam-Status: No, score=0.0 required=5.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, UNPARSEABLE_RELAY autolearn=unavailable autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on complete.lackof.org X-Greylist: Delayed for 00:09:17 by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.28]); Tue, 22 Jan 2019 19:35:51 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.28]); Tue, 22 Jan 2019 19:35:51 +0000 (UTC) for IP:'198.49.126.79' DOMAIN:'complete.lackof.org' HELO:'complete.lackof.org' FROM:'dannf@dannf.org' RCPT:'' X-RedHat-Spam-Score: 0.001 (HEADER_FROM_DIFFERENT_DOMAINS) 198.49.126.79 complete.lackof.org 198.49.126.79 complete.lackof.org X-Scanned-By: MIMEDefang 2.78 on 10.5.110.28 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 X-loop: libvir-list@redhat.com Cc: laine@laine.org Subject: [libvirt] [PATCH v3 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: , Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.30]); Tue, 22 Jan 2019 19:36:02 +0000 (UTC) From: Radoslaw Biernacki 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 Signed-off-by: dann frazier --- src/util/virhostdev.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -- 2.20.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 41d4e8d936..880ca083d4 100644 --- a/src/util/virhostdev.c +++ b/src/util/virhostdev.c @@ -314,7 +314,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);