va:display: Don't close an fd with negative value
authorMengkejiergeli Ba <mengkejiergeli.ba@intel.com>
Tue, 12 Oct 2021 09:50:31 +0000 (17:50 +0800)
committerGStreamer Marge Bot <gitlab-merge-bot@gstreamer-foundation.org>
Thu, 14 Oct 2021 11:12:41 +0000 (11:12 +0000)
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>

subprojects/gst-plugins-bad/gst-libs/gst/va/gstvadisplay_drm.c

index d2a32fb..d92569a 100644 (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