va:display: Don't close an fd with negative value

Cannot pass negative parameter to close() and thus no need to apply
close() when fd < 0.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1131>
This commit is contained in:
Mengkejiergeli Ba 2021-10-12 17:50:31 +08:00 committed by GStreamer Marge Bot
parent 5e7aa06257
commit 8f678c95d6

View file

@ -140,7 +140,6 @@ gst_va_display_drm_create_va_display (GstVaDisplay * display)
if (fd < 0) {
GST_WARNING_OBJECT (self, "Failed to open %s: %s", self->path,
g_strerror (saved_errno));
close (fd);
return 0;
}
#if HAVE_LIBDRM