mirror of
https://gitlab.freedesktop.org/xorg/xserver.git
synced 2025-12-27 04:40:06 +01:00
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
1 changed files with 5 additions and 0 deletions
|
|
@ -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…
Add table
Reference in a new issue