uterm: monitor: fix crash during device hotplug
We must make sure that the returned value is non-NULL, otherwise we crash during device-change events for non-DRM-Hotplug events. Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
This commit is contained in:
parent
f084da1852
commit
d97fc0baf0
@ -530,7 +530,7 @@ static void monitor_udev_change(struct uterm_monitor *mon,
|
|||||||
|
|
||||||
/* DRM devices send hotplug events; catch them here */
|
/* DRM devices send hotplug events; catch them here */
|
||||||
val = udev_device_get_property_value(dev, "HOTPLUG");
|
val = udev_device_get_property_value(dev, "HOTPLUG");
|
||||||
if (!strcmp(val, "1")) {
|
if (val && !strcmp(val, "1")) {
|
||||||
memset(&ev, 0, sizeof(ev));
|
memset(&ev, 0, sizeof(ev));
|
||||||
ev.type = UTERM_MONITOR_HOTPLUG_DEV;
|
ev.type = UTERM_MONITOR_HOTPLUG_DEV;
|
||||||
ev.seat = sdev->seat;
|
ev.seat = sdev->seat;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user