1
0
mirror of https://github.com/systemd/systemd.git synced 2024-10-28 20:25:38 +03:00

[PATCH] prevent udevd crash if DEVPATH is not set

Just move the event straight to the exec list and don't try
to compare a NULL pointer.
This commit is contained in:
kay.sievers@vrfy.org 2004-11-19 03:49:13 +01:00 committed by Greg KH
parent 4bee999405
commit 80513ea38f

View File

@ -153,9 +153,14 @@ static void udev_run(struct hotplug_msg *msg)
static struct hotplug_msg *running_with_devpath(struct hotplug_msg *msg)
{
struct hotplug_msg *loop_msg;
list_for_each_entry(loop_msg, &running_list, list)
if (strncmp(loop_msg->devpath, msg->devpath, sizeof(loop_msg->devpath)) == 0)
list_for_each_entry(loop_msg, &running_list, list) {
if (loop_msg->devpath == NULL || msg->devpath == NULL)
continue;
if (strcmp(loop_msg->devpath, msg->devpath) == 0)
return loop_msg;
}
return NULL;
}