v4l2: minor fix for closing the fd

The fd returned by open() could theoretically be 0 as well.

Coverity CID 1211823.
This commit is contained in:
Tim-Philipp Müller 2014-05-05 12:07:25 +01:00
parent 985897d8d9
commit 17c107d4e4

View file

@ -102,7 +102,7 @@ gst_v4l2_probe_and_register (GstPlugin * plugin)
GstCaps *src_caps, *sink_caps;
gchar *basename;
if (video_fd > 0)
if (video_fd >= 0)
close (video_fd);
video_fd = open (it->device_path, O_RDWR);
@ -158,7 +158,7 @@ gst_v4l2_probe_and_register (GstPlugin * plugin)
break;
}
if (video_fd > 0)
if (video_fd >= 0)
close (video_fd);
gst_v4l2_iterator_free (it);