modesetting: fix crashes caused by udev race conditions
So the kernel removes the device, and the driver processes the first udev event, and gets no output back from the kernel, so it check and don't fall over. This fixes a couple of crashes seen when hotplugging USB devices. Signed-off-by: Dave Airlie <airlied@redhat.com>
This commit is contained in:
parent
0b198248ec
commit
8650ff14a5
|
@ -589,6 +589,8 @@ drmmode_output_detect(xf86OutputPtr output)
|
|||
drmModeFreeConnector(drmmode_output->mode_output);
|
||||
|
||||
drmmode_output->mode_output = drmModeGetConnector(drmmode->fd, drmmode_output->output_id);
|
||||
if (!drmmode_output->mode_output)
|
||||
return XF86OutputStatusDisconnected;
|
||||
|
||||
switch (drmmode_output->mode_output->connection) {
|
||||
case DRM_MODE_CONNECTED:
|
||||
|
@ -683,6 +685,9 @@ drmmode_output_dpms(xf86OutputPtr output, int mode)
|
|||
drmModeConnectorPtr koutput = drmmode_output->mode_output;
|
||||
drmmode_ptr drmmode = drmmode_output->drmmode;
|
||||
|
||||
if (!koutput)
|
||||
return;
|
||||
|
||||
drmModeConnectorSetProperty(drmmode->fd, koutput->connector_id,
|
||||
drmmode_output->dpms_enum_id, mode);
|
||||
return;
|
||||
|
|
Loading…
Reference in New Issue