OSDN Git Service

Don't close fds on imported buffers
authorRob Herring <robh@kernel.org>
Thu, 24 Aug 2017 14:38:25 +0000 (09:38 -0500)
committerRob Herring <robh@kernel.org>
Wed, 6 Sep 2017 16:43:45 +0000 (11:43 -0500)
The fds should only be closed if we allocated the handle.

Signed-off-by: Rob Herring <robh@kernel.org>
gralloc_gbm.cpp

index 8a30e70..a403e99 100644 (file)
@@ -213,11 +213,6 @@ static struct gralloc_gbm_bo_t *gbm_alloc(struct gbm_device *gbm,
 
 static void gbm_free(struct gralloc_gbm_bo_t *bo)
 {
-       struct gralloc_gbm_handle_t *handle = bo->handle;
-
-       close(handle->prime_fd);
-       handle->prime_fd = -1;
-
        gbm_bo_destroy(bo->bo);
        delete bo;
 }
@@ -433,6 +428,7 @@ static void gralloc_gbm_bo_destroy(struct gralloc_gbm_bo_t *bo)
                handle->data = 0;
        }
        else {
+               native_handle_close(handle);
                delete handle;
        }
 }