Bug 93779 - Fix null pointer in FreeRec()
Summary: Fix null pointer in FreeRec()
Status: RESOLVED MOVED
Alias: None
Product: xorg
Classification: Unclassified
Component: Driver/modesetting (show other bugs)
Version: git
Hardware: Other All
: medium normal
Assignee: Xorg Project Team
QA Contact: Xorg Project Team
URL:
Whiteboard:
Keywords: patch
Depends on:
Blocks:
 
Reported: 2016-01-19 20:24 UTC by Thomas Meyer
Modified: 2018-12-13 18:09 UTC (History)
0 users

See Also:
i915 platform:
i915 features:


Attachments
Fix null pointer (599 bytes, patch)
2016-01-19 20:26 UTC, Thomas Meyer
no flags Details | Splinter Review

Description Thomas Meyer 2016-01-19 20:24:29 UTC
There seem to be a bug in the modesetting driver:

(gdb) p (modesettingPtr)((scrn)->driverPrivate)
$6 = (struct _modesettingRec *) 0x0

driverPrivate is NULL. It is set to NULL in FreeRec function:

 625│         return;
 626│->   pScrn->driverPrivate = NULL;
 627│
 628│     if (ms->fd > 0) {
 629│         modesettingEntPtr ms_ent;
 630│         int ret;
 631│
 632├>        ms_ent = ms_ent_priv(pScrn);
 633│         ms_ent->fd_ref--;
 634│         if (!ms_ent->fd_ref) {
 635│             if (ms->pEnt->location.type == BUS_PCI)
 636│                 ret = drmClose(ms->fd);
 637│             else
 638│ #ifdef XF86_PDEV_SERVER_FD
 639│                 if (!(ms->pEnt->location.type == BUS_PLATFORM &&
/usr/src/debug/xorg-server-1.18.0/hw/xfree86/drivers/modesetting/driver.c   

line 626 clears the pointer and in line 632 it's used later on again by ms_ent_priv().

See also https://bugzilla.redhat.com/show_bug.cgi?id=1273183
Comment 1 Thomas Meyer 2016-01-19 20:26:44 UTC
Created attachment 121144 [details] [review]
Fix null pointer
Comment 2 GitLab Migration User 2018-12-13 18:09:11 UTC
-- GitLab Migration Automatic Message --

This bug has been migrated to freedesktop.org's GitLab instance and has been closed from further activity.

You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.freedesktop.org/xorg/xserver/issues/23.


Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.