Skip to contentSkip to conversation

xf86drm: Be sure to closedir before return

PATCH In review Kevin Strasser 2 participants 2 messages May 18, 2018 – May 21, 2018

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 xf86drm: Be sure to closedir before return

removed in commit bb45ce4e3ac751315bfd7fbfd9e1425bf515ec0d

Adding it back as it is still needed in the case where we don't find a match.

---
 xf86drm.c | 2 ++
 1 file changed, 2 insertions(+)
xf86drm.c +2 -0
index 3a9d0ed..056dfa4 100644
@@ -2855,6 +2855,8 @@ static char *drmGetMinorNameForFD(int fd, int type)
             return strdup(dev_name);
         }
     }
+
+    closedir(sysdir);
     return NULL;
 #else
     struct stat sbuf;
Signature · 6 lines
2.7.4

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
Reviewed-by on v1 1/1
#1 lore raw
Quoted 6 lines · Kevin Strasser

removed in commit bb45ce4e3ac751315bfd7fbfd9e1425bf515ec0d

Adding it back as it is still needed in the case where we don't find a match.

Good catch, thanks!

Fixes bb45ce4e3ac751315bfd "libdrm: Use readdir instead of readdir_r to

avoid build warnings"

... and pushed :)

Quoted 24 lines
---
 xf86drm.c | 2 ++
 1 file changed, 2 insertions(+)
xf86drm.c +2 -0
index 3a9d0ed..056dfa4 100644
@@ -2855,6 +2855,8 @@ static char *drmGetMinorNameForFD(int fd, int type)
             return strdup(dev_name);
         }
     }
+
+    closedir(sysdir);
     return NULL;
 #else
     struct stat sbuf;
Signature · 6 lines
2.7.4

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel