Commit da8ee260 authored by Dave Airlie's avatar Dave Airlie

xfree86/hotplug: cleanup properly if the screen fails to initialise

Due to another bug, the modesetting/udl driver would fail to init properly
on hotplug, when it did the code didn't clean up properly, and on removing
the device the server could crash.

Found in F18 testing.
Signed-off-by: default avatarDave Airlie <airlied@redhat.com>
Reviewed-by: Aaron Plattner's avatarAaron Plattner <aplattner@nvidia.com>
parent 90642948
......@@ -438,7 +438,12 @@ xf86platformAddDevice(int index)
}
scr_index = AddGPUScreen(xf86GPUScreens[i]->ScreenInit, 0, NULL);
if (scr_index == -1) {
xf86DeleteScreen(xf86GPUScreens[i]);
xf86UnclaimPlatformSlot(&xf86_platform_devices[index], NULL);
xf86NumGPUScreens = old_screens;
return -1;
}
dixSetPrivate(&xf86GPUScreens[i]->pScreen->devPrivates,
xf86ScreenKey, xf86GPUScreens[i]);
......
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