mirror of
https://github.com/X11Libre/xf86-video-ati.git
synced 2026-03-24 01:24:43 +00:00
modesetting: Reset output_id if drmModeGetConnector failed
If drmModeGetConnector() fails in drmmode_output_detect(), we have to reset the output_id to -1 too. Yet another spot leading to a potential NULL dereference when handling the mode_output member as output_id was != -1. Though, this case should be very hard to hit. Signed-off-by: Daniel Martin <consume.noise@gmail.com> (Ported from amdgpu commit 10054b6c3d9a755b30abb43020121b9631fa296d)
This commit is contained in:
committed by
Michel Dänzer
parent
1ef12a92ca
commit
aef8fe6e9e
@@ -1424,9 +1424,12 @@ drmmode_output_detect(xf86OutputPtr output)
|
||||
xf86OutputStatus status;
|
||||
drmModeFreeConnector(drmmode_output->mode_output);
|
||||
|
||||
drmmode_output->mode_output = drmModeGetConnector(pRADEONEnt->fd, drmmode_output->output_id);
|
||||
if (!drmmode_output->mode_output)
|
||||
drmmode_output->mode_output =
|
||||
drmModeGetConnector(pRADEONEnt->fd, drmmode_output->output_id);
|
||||
if (!drmmode_output->mode_output) {
|
||||
drmmode_output->output_id = -1;
|
||||
return XF86OutputStatusDisconnected;
|
||||
}
|
||||
|
||||
switch (drmmode_output->mode_output->connection) {
|
||||
case DRM_MODE_CONNECTED:
|
||||
|
||||
Reference in New Issue
Block a user