summaryrefslogtreecommitdiff
path: root/hw/xfree86/common
diff options
context:
space:
mode:
authorJeff Smith <whydoubt@gmail.com>2018-02-04 23:17:52 -0600
committerAdam Jackson <ajax@redhat.com>2018-02-05 15:40:13 -0500
commit1a24a0ae7b1a7400735530a21ac8c0247723223d (patch)
treeb938a84135753205027a96c62c2f17ce1cebfc83 /hw/xfree86/common
parent1e23f03dd5fb6c981ef6d64c084f72fc6820ed71 (diff)
xfree86: Do not use uninitialized pointer during probe
Commits b5dffbb and d75ffcd introduce code in xf86platformProbe() that references a member of xf86configptr. However, when using the "-configure" option, xf86configptr may not be initialized when xf86platformProbe() is called. Avoid referencing a member of xf86configptr if uninitialized. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=100405 Signed-off-by: Jeff Smith <whydoubt@gmail.com> Reviewed-by: Adam Jackson <ajax@redhat.com>
Diffstat (limited to 'hw/xfree86/common')
-rw-r--r--hw/xfree86/common/xf86platformBus.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/hw/xfree86/common/xf86platformBus.c b/hw/xfree86/common/xf86platformBus.c
index 844bf7e93..cef47da03 100644
--- a/hw/xfree86/common/xf86platformBus.c
+++ b/hw/xfree86/common/xf86platformBus.c
@@ -276,7 +276,8 @@ xf86platformProbe(void)
{
int i;
Bool pci = TRUE;
- XF86ConfOutputClassPtr cl;
+ XF86ConfOutputClassPtr cl, cl_head = (xf86configptr) ?
+ xf86configptr->conf_outputclass_lst : NULL;
char *old_path, *path = NULL;
config_odev_probe(xf86PlatformDeviceProbe);
@@ -296,7 +297,7 @@ xf86platformProbe(void)
* Deal with OutputClass ModulePath directives, these must be
* processed before we do any module loading.
*/
- for (cl = xf86configptr->conf_outputclass_lst; cl; cl = cl->list.next) {
+ for (cl = cl_head; cl; cl = cl->list.next) {
if (!OutputClassMatches(cl, &xf86_platform_devices[i]))
continue;
@@ -317,7 +318,7 @@ xf86platformProbe(void)
/* First see if there is an OutputClass match marking a device as primary */
for (i = 0; i < xf86_num_platform_devices; i++) {
struct xf86_platform_device *dev = &xf86_platform_devices[i];
- for (cl = xf86configptr->conf_outputclass_lst; cl; cl = cl->list.next) {
+ for (cl = cl_head; cl; cl = cl->list.next) {
if (!OutputClassMatches(cl, dev))
continue;