loader: Check dlsym() did not fail in libudev_get_device_name_for_fd()
authorJuha-Pekka Heikkila <juhapekka.heikkila@gmail.com>
Fri, 27 Jun 2014 12:22:04 +0000 (15:22 +0300)
committerTapani Pälli <tapani.palli@intel.com>
Tue, 23 Sep 2014 07:25:02 +0000 (10:25 +0300)
Signed-off-by: Juha-Pekka Heikkila <juhapekka.heikkila@gmail.com>
Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
src/loader/loader.c

index bdd39069149c950cdcd7e8fd8ba89ce6fa150463..94c993ac8415c1449f873ecab17d94bd3cf66da2 100644 (file)
@@ -594,6 +594,9 @@ libudev_get_device_name_for_fd(int fd)
                (struct udev_device *));
    UDEV_SYMBOL(struct udev *, udev_unref, (struct udev *));
 
+   if (dlsym_failed)
+      return NULL;
+
    udev = udev_new();
    device = udev_device_new_from_fd(udev, fd);
    if (device == NULL)