From patchwork Sat Nov 10 12:56:24 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Radoslaw Biernacki X-Patchwork-Id: 150737 Delivered-To: patch@linaro.org Received: by 2002:a2e:299d:0:0:0:0:0 with SMTP id p29-v6csp1041367ljp; Sat, 10 Nov 2018 05:19:59 -0800 (PST) X-Google-Smtp-Source: AJdET5dXmPoDo3uIykFzocmPtjgAenlo56BwR66KLgnEWLYNslP3CfS7CkjHjUwI2IWfEdPftuEZ X-Received: by 2002:ac8:2211:: with SMTP id o17mr12675367qto.170.1541855999660; Sat, 10 Nov 2018 05:19:59 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1541855999; cv=none; d=google.com; s=arc-20160816; b=GQr0lRsC/gKxZKqEIba+ZvzLvJbwFDtXGXO83/lEZISDt00OZE2Q9tXMOsh9c4BdtP kZheLKNpDtQGNZB7a7369GfWR/Xcu8nmIJyQLJW355zyzEgKLk+nWmGfoYy3wqWk3Fqn iRU1gieGT+WAMVmJ63OVBE9jKFe+MyvL7CLcIXRHSc3Map6Bq6pb44enhTajIJ70EBQ9 jPQUI90HgF3jHE1JJBjv6FXgpbwoy8YaTtIb1ydA/Kfq7CZTEI3EQ7F1PnntnKYofZAO nc1ETB9xGB0NZsJ/J7NrHNipP1ugB8jNBPXL/w0mGJjd3QmBD+kWBrxam8nCYGuWcVoe V88Q== 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=Dj776dMmyQWTQrjjHNBGDAbpZYVXe4ULOd0v6twuo/o=; b=KMgLW+phnwavIH7UZxuBhdsVPV1ahneH88Sy/Trn0xQCP6qcU9qK13xDOT6v3eI+ni J0zj5wcoAQhaQS1zFm/F/gbZJdXP4UnkCI/fQwiEbWN/ow9qDOeN5Z+1X9pAOMYZStGn +U9k4cPckzvKM4wn1xqRhZVzM55TUuaHudbr8IT2QtwC1HmGOL2X8cdxejENWBYZDA0H JgaYhGH98YcBDBahokHtNrdiV/qnfvpy2nnxkQtyf6WHh4DLCHTrZVYrRhExU9o4isUE s3eE7aF3xmEagdMWv1hv8UZgRX4HSOQevFEoqZ8t0LRcbSU3OxdWGWMuesPga/eurZUm 2Aug== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=Du2JqTxK; 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 z129si3057759qkb.241.2018.11.10.05.19.59 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 10 Nov 2018 05:19:59 -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=Du2JqTxK; 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-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id B9B623083392; Sat, 10 Nov 2018 13:19:57 +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 E2C285C21E; Sat, 10 Nov 2018 13:19:56 +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 BC1CC4BB79; Sat, 10 Nov 2018 13:19:55 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id wAACuhL3022818 for ; Sat, 10 Nov 2018 07:56:43 -0500 Received: by smtp.corp.redhat.com (Postfix) id 472E15D736; Sat, 10 Nov 2018 12:56:43 +0000 (UTC) Delivered-To: libvir-list@redhat.com Received: from mx1.redhat.com (ext-mx08.extmail.prod.ext.phx2.redhat.com [10.5.110.32]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 3DD325D6B3 for ; Sat, 10 Nov 2018 12:56:41 +0000 (UTC) Received: from mail-lf1-f68.google.com (mail-lf1-f68.google.com [209.85.167.68]) (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 F1445C0587D2 for ; Sat, 10 Nov 2018 12:56:39 +0000 (UTC) Received: by mail-lf1-f68.google.com with SMTP id z13so3195581lfe.11 for ; Sat, 10 Nov 2018 04:56:39 -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=eFD9V7bbfg465fkVJVRo8f/kVX4tbBk+ZG1ldSr5ho4=; b=Du2JqTxKjWq/FYyW9b5ZyFrBihZybtufDe2BTibr3/pzy3eRpFvBmaKHHR5K54Pin0 gvffwW7Ct8FBPjRncDT1eTfZSsbOwc89uHW/GCAjJnFp8ZVs+3PmXyd0pKC7LjJzMsXB t7wx8qd2VF8bTUJtjnI2e8ne+kiKaBA2H95Uw= 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=eFD9V7bbfg465fkVJVRo8f/kVX4tbBk+ZG1ldSr5ho4=; b=egYggBN226iOkG99mUy5PYuPYMb7/pFpjnqMqYrBig9YiZE2KOAoYY3OssoVFtf1Dp 9/OesjGgUcq4EcOMXi24aaZnFh1mIqIZsl5gopWQmRn2bnYZY+xc2E2/2cTGtlK8wtwM 3RumQqjvdxUlYCygeLBxeWT/jpiIYV6aNMNwZD4zBgd5Z/5gA6MmZHJJ7vnPwE30uzdV jnKgCdPDnSlKFOrHhNm0YYzz1Tq17umKiC16mRI3V+MaoyC8AcFNkFWews4CrVfLzWM+ +Vdbj/82Op6cUx+nd42BbiYiLfOlKQEC+wXj/K9AQb1hNrHXYM6PZ9PBQAP24qa6b/Mu JxMw== X-Gm-Message-State: AGRZ1gLnPVZpF4anOZk3eiXq9zH2UL87I+TLCLOyaaUf/AlYlKbL6Le3 O8M9R1Fs9e/3apMx/GRlf1zOSacAAxI= X-Received: by 2002:a19:40cc:: with SMTP id n195mr7447771lfa.40.1541854598079; Sat, 10 Nov 2018 04:56:38 -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 h16-v6sm2145024lfc.0.2018.11.10.04.56.37 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 10 Nov 2018 04:56:37 -0800 (PST) From: Radoslaw Biernacki To: libvir-list@redhat.com Date: Sat, 10 Nov 2018 13:56:24 +0100 Message-Id: <20181110125624.1168-5-radoslaw.biernacki@linaro.org> In-Reply-To: <20181110125624.1168-1-radoslaw.biernacki@linaro.org> References: <20181110125624.1168-1-radoslaw.biernacki@linaro.org> X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.32]); Sat, 10 Nov 2018 12:56:40 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.32]); Sat, 10 Nov 2018 12:56:40 +0000 (UTC) for IP:'209.85.167.68' DOMAIN:'mail-lf1-f68.google.com' HELO:'mail-lf1-f68.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.167.68 mail-lf1-f68.google.com 209.85.167.68 mail-lf1-f68.google.com X-Scanned-By: MIMEDefang 2.78 on 10.5.110.32 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-loop: libvir-list@redhat.com Cc: laine@laine.org Subject: [libvirt] [PATCH 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.16 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.44]); Sat, 10 Nov 2018 13:19:58 +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 --- 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);