summaryrefslogtreecommitdiff
path: root/udevd.c
diff options
context:
space:
mode:
Diffstat (limited to 'udevd.c')
-rw-r--r--udevd.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/udevd.c b/udevd.c
index 43f3f0324b..dd505d03d9 100644
--- a/udevd.c
+++ b/udevd.c
@@ -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;
}