surface: Close request fd when destroying

Signed-off-by: Paul Kocialkowski <paul.kocialkowski@bootlin.com>
This commit is contained in:
Paul Kocialkowski
2018-04-25 11:58:55 +02:00
parent 1477ba3861
commit 3049a90d7e
+4
View File
@@ -29,6 +29,7 @@
#include <assert.h> #include <assert.h>
#include <string.h> #include <string.h>
#include <stdlib.h> #include <stdlib.h>
#include <unistd.h>
#include <errno.h> #include <errno.h>
#include <sys/mman.h> #include <sys/mman.h>
@@ -123,6 +124,9 @@ VAStatus SunxiCedrusDestroySurfaces(VADriverContextP context,
if (surface_object->source_data != NULL && surface_object->source_size > 0) if (surface_object->source_data != NULL && surface_object->source_size > 0)
munmap(surface_object->source_data, surface_object->source_size); munmap(surface_object->source_data, surface_object->source_size);
if (surface_object->request_fd >= 0)
close(surface_object->request_fd);
for (j = 0; j < 2; j++) for (j = 0; j < 2; j++)
if (surface_object->destination_data[j] != NULL && surface_object->destination_size[j] > 0) if (surface_object->destination_data[j] != NULL && surface_object->destination_size[j] > 0)
munmap(surface_object->destination_data[j], surface_object->destination_size[j]); munmap(surface_object->destination_data[j], surface_object->destination_size[j]);