From f4d421ae423157ac09bf723469808fb50a2f8e29 Mon Sep 17 00:00:00 2001 From: Weifeng Liu Date: Wed, 19 Feb 2025 03:02:17 +0000 Subject: [PATCH] Fix double free in driver loading Tracked-On: OAM-129205 Signed-off-by: Weifeng Liu --- cros_gralloc/cros_gralloc_driver.cc | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/cros_gralloc/cros_gralloc_driver.cc b/cros_gralloc/cros_gralloc_driver.cc index 39784c4..cc60ba1 100644 --- a/cros_gralloc/cros_gralloc_driver.cc +++ b/cros_gralloc/cros_gralloc_driver.cc @@ -204,11 +204,8 @@ cros_gralloc_driver::cros_gralloc_driver(): drivers_(GPU_GRP_TYPE_NR, nullptr) } // hit any of undesired render node - if (j < ARRAY_SIZE(undesired)) { - drmFreeVersion(version); - close(fd); + if (j < ARRAY_SIZE(undesired)) continue; - } if (fallback_fd == -1) fallback_fd = fd;