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:
David Herrmann 2012-08-12 13:26:16 +02:00
parent f084da1852
commit d97fc0baf0

View File

@ -530,7 +530,7 @@ static void monitor_udev_change(struct uterm_monitor *mon,
/* DRM devices send hotplug events; catch them here */
val = udev_device_get_property_value(dev, "HOTPLUG");
if (!strcmp(val, "1")) {
if (val && !strcmp(val, "1")) {
memset(&ev, 0, sizeof(ev));
ev.type = UTERM_MONITOR_HOTPLUG_DEV;
ev.seat = sdev->seat;