[Mesa-dev] [PATCH 5/9] loader: Check dlsym() did not fail in libudev_get_device_name_for_fd()

Juha-Pekka Heikkila juhapekka.heikkila at gmail.com
Thu Jul 3 01:13:15 PDT 2014


Signed-off-by: Juha-Pekka Heikkila <juhapekka.heikkila at gmail.com>
---
 src/loader/loader.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/src/loader/loader.c b/src/loader/loader.c
index 47e1f58..2205a9c 100644
--- a/src/loader/loader.c
+++ b/src/loader/loader.c
@@ -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)
-- 
1.8.1.2



More information about the mesa-dev mailing list