1 Star 0 Fork 71

tzr/libvirt

forked from src-openEuler/libvirt 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
tests-upstream-Fixing-compiler-warning-in-cputest.patch 1.70 KB
一键复制 编辑 原始数据 按行查看 历史
Jiabo Feng 提交于 2023-11-29 15:42 . libvirt update to version 6.2.0-60
From 53ff014d6e62a0bbef7e9fda360ddfe197115324 Mon Sep 17 00:00:00 2001
From: laokz <zhangkai@iscas.ac.cn>
Date: Thu, 14 Sep 2023 11:46:39 +0800
Subject: [PATCH] tests: upstream Fixing compiler warning in cputest
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Reference: https://github.com/libvirt/libvirt/commit/67c77744d74fe99a6b0e4ddef6869b305e29d6aa
---
tests: Fixing compiler warning in cputest
Found when building on Fedora 36 on s390x.
C compiler for the host machine: gcc (gcc 12.0.1 "gcc (GCC) 12.0.1 20220308 (Red Hat 12.0.1-0)")
C linker for the host machine: gcc ld.bfd 2.37-24
In function ‘cpuTestUpdateLiveCompare’,
inlined from ‘cpuTestUpdateLive’ at ../dist-unpack/libvirt-8.2.5/tests/cputest.c:784:12:
../dist-unpack/libvirt-8.2.5/tests/cputest.c:696:21: warning: potential null pointer dereference [-Wnull-dereference]
696 | featAct->policy == VIR_CPU_FEATURE_REQUIRE) ||
| ~~~~~~~^~~~~~~~
Signed-off-by: Boris Fiuczynski <fiuczy@linux.ibm.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
---
tests/cputest.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/tests/cputest.c b/tests/cputest.c
index 3657fa4095..8c22fb3ee9 100644
--- a/tests/cputest.c
+++ b/tests/cputest.c
@@ -760,7 +760,7 @@ cpuTestUpdateLiveCompare(virArch arch,
if ((cmp == 0 &&
featAct->policy == VIR_CPU_FEATURE_REQUIRE &&
featExp->policy == VIR_CPU_FEATURE_DISABLE) ||
- (cmp < 0 &&
+ (cmp < 0 && featAct &&
featAct->policy == VIR_CPU_FEATURE_REQUIRE) ||
(cmp > 0 &&
featExp->policy == VIR_CPU_FEATURE_DISABLE)) {
--
2.27.0
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/tom0392/libvirt.git
git@gitee.com:tom0392/libvirt.git
tom0392
libvirt
libvirt
master

搜索帮助