!4 update to 0.16 version

Merge pull request !4 from Markeryang/openEuler-20.03-LTS
This commit is contained in:
openeuler-ci-bot 2020-08-25 18:58:21 +08:00 committed by Gitee
commit 928ef06565
5 changed files with 6 additions and 39 deletions

View File

@ -1,35 +0,0 @@
From 44f3dd08f99ba67e967980daaea2b800c68e2659 Mon Sep 17 00:00:00 2001
From: Olivier Fourdan <ofourdan@redhat.com>
Date: Wed, 24 Oct 2018 10:11:49 +0200
Subject: [PATCH 1/3] linux: Set number of devices to 0 in case of error
pci_sys is a global variable which is populated on init, and in case of
error reading sysfs on Linux, the devices are NULL, but the number of
devices is left unchanged.
As a result, we may crash in `pci_device_next()` which relies on the
number of devices.
To fix the issue, simply reset the number of devices to zero in case of
error so we don't try to access indices of a NULL array later on.
Signed-off-by: Olivier Fourdan <ofourdan@redhat.com>
---
src/linux_sysfs.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/src/linux_sysfs.c b/src/linux_sysfs.c
index a8bc2e1..e74ad72 100644
--- a/src/linux_sysfs.c
+++ b/src/linux_sysfs.c
@@ -264,6 +264,7 @@ populate_entries( struct pci_system * p )
if (err) {
free(p->devices);
p->devices = NULL;
+ p->num_devices = 0;
}
return err;
--
2.19.1

Binary file not shown.

BIN
libpciaccess-0.16.tar.bz2 Normal file

Binary file not shown.

View File

@ -1,6 +1,6 @@
Name: libpciaccess
Version: 0.14
Release: 3
Version: 0.16
Release: 1
Summary: Generic PCI access library
License: MIT
URL: https://www.x.org/
@ -9,8 +9,7 @@ Source0: https://www.x.org/archive/individual/lib/%{name}-%{version}.tar.
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-buildroot
Patch0: libpciaccess-rom-size.patch
Patch6000: 6000-linux-Set-number-of-devices-to-0-in-case-of-error.patch
Patch0: 0000-libpciaccess-rom-size.patch
BuildRequires: autoconf automake libtool pkgconfig git xorg-x11-util-macros
Requires: hwdata
@ -55,6 +54,9 @@ rm -f $RPM_BUILD_ROOT/%{_libdir}/*.la
%changelog
* Wed Jul 29 2020 yanglongkang <yanglongkang@huawei.com> - 0.16-1
- update to 0.16 version
* Tue Aug 27 2019 zoujing <zoujing13@huawei.com> - 0.14-3
- Type:enhancemnet
- ID:NA