modesetting: clean up leaks
Signed-off-by: Maarten Lankhorst <maarten.lankhorst@canonical.com>
This commit is contained in:
parent
1754973206
commit
6b79a8791d
|
@ -206,7 +206,7 @@ static Bool probe_hw(char *dev)
|
||||||
int fd = open_hw(dev);
|
int fd = open_hw(dev);
|
||||||
if (fd != -1) {
|
if (fd != -1) {
|
||||||
close(fd);
|
close(fd);
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
@ -530,15 +530,27 @@ static void msBlockHandler(BLOCKHANDLER_ARGS_DECL)
|
||||||
static void
|
static void
|
||||||
FreeRec(ScrnInfoPtr pScrn)
|
FreeRec(ScrnInfoPtr pScrn)
|
||||||
{
|
{
|
||||||
|
modesettingPtr ms;
|
||||||
|
|
||||||
if (!pScrn)
|
if (!pScrn)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (!pScrn->driverPrivate)
|
|
||||||
return;
|
|
||||||
|
|
||||||
free(pScrn->driverPrivate);
|
|
||||||
|
|
||||||
|
ms = modesettingPTR(pScrn);
|
||||||
|
if (!ms)
|
||||||
|
return;
|
||||||
pScrn->driverPrivate = NULL;
|
pScrn->driverPrivate = NULL;
|
||||||
|
|
||||||
|
if (ms->fd > 0) {
|
||||||
|
int ret;
|
||||||
|
|
||||||
|
if (ms->pEnt->location.type == BUS_PCI)
|
||||||
|
ret = drmClose(ms->fd);
|
||||||
|
else
|
||||||
|
ret = close(ms->fd);
|
||||||
|
}
|
||||||
|
free(ms->Options);
|
||||||
|
free(ms);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static Bool
|
static Bool
|
||||||
|
@ -596,8 +608,8 @@ PreInit(ScrnInfoPtr pScrn, int flags)
|
||||||
|
|
||||||
#if XSERVER_PLATFORM_BUS
|
#if XSERVER_PLATFORM_BUS
|
||||||
if (pEnt->location.type == BUS_PLATFORM) {
|
if (pEnt->location.type == BUS_PLATFORM) {
|
||||||
char *path = xf86_get_platform_device_attrib(pEnt->location.id.plat, ODEV_ATTRIB_PATH);
|
char *path = xf86_get_platform_device_attrib(pEnt->location.id.plat, ODEV_ATTRIB_PATH);
|
||||||
ms->fd = open_hw(path);
|
ms->fd = open_hw(path);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
#endif
|
#endif
|
||||||
|
|
Loading…
Reference in New Issue