Commit 099489b7 authored by Keith Busch's avatar Keith Busch Committed by Emma Anholt
Browse files

Ignore 32-bit domains



A pci "domain" need not be limited to the 16-bits. The Linux kernel
currently supports 32-bit domains which cause startx to segfault. Updating
libpciaccess to support 32-bit domains breaks the library's ABI, and
domains requiring 32-bits are not necessary for startx anyway, so this
patch ignores them.
Reported-by: default avatarPawel Baldysiak <pawel.baldysiak@intel.com>
Signed-off-by: default avatarKeith Busch <keith.busch@intel.com>
Reviewed-by: Emma Anholt's avatarEric Anholt <eric@anholt.net>
parent 201d1a76
...@@ -119,18 +119,28 @@ pci_system_linux_sysfs_create( void ) ...@@ -119,18 +119,28 @@ pci_system_linux_sysfs_create( void )
/** /**
* Filter out the names "." and ".." from the scanned sysfs entries. * Filter out the names "." and ".." from the scanned sysfs entries, and
* domains requiring 32-bits.
* *
* \param d Directory entry being processed by \c scandir. * \param d Directory entry being processed by \c scandir.
* *
* \return * \return
* Zero if the entry name matches either "." or "..", non-zero otherwise. * Zero if the entry name matches either "." or "..", or the domain requires
* 32 bits, non-zero otherwise.
* *
* \sa scandir, populate_entries * \sa scandir, populate_entries
*/ */
static int static int
scan_sys_pci_filter( const struct dirent * d ) scan_sys_pci_filter( const struct dirent * d )
{ {
if (d->d_name[0] != '.') {
unsigned dom = 0;
sscanf(d->d_name, "%x:", &dom);
if (dom > USHRT_MAX)
return 0;
}
return !((strcmp( d->d_name, "." ) == 0) return !((strcmp( d->d_name, "." ) == 0)
|| (strcmp( d->d_name, ".." ) == 0)); || (strcmp( d->d_name, ".." ) == 0));
} }
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment