From: Charles Giessen Date: Wed, 12 May 2021 23:42:00 +0000 (-0600) Subject: loader: Handle OOM in loader_phys_dev_ext_gpa X-Git-Tag: upstream/v1.3.207~226 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=782cbe6f7df81a45f213a5e4d5be3904ef040b5e;p=platform%2Fupstream%2FVulkan-Loader.git loader: Handle OOM in loader_phys_dev_ext_gpa Removing some dead code revealed a case where a potencial OOM situation was not being handled. Change-Id: Ibc5ad607f6adc0f590f663ab928c1abca6732d96 --- diff --git a/loader/loader.c b/loader/loader.c index ab50f725..cd7c63ff 100644 --- a/loader/loader.c +++ b/loader/loader.c @@ -4329,12 +4329,12 @@ bool loader_phys_dev_ext_gpa(struct loader_instance *inst, const char *funcName, idx = murmurhash(funcName, strlen(funcName), seed) % MAX_NUM_UNKNOWN_EXTS; if (perform_checking && !loader_name_in_phys_dev_ext_table(inst, &idx, funcName)) { uint32_t i; - bool added = false; // Only need to add first one to get index in Instance. Others will use // the same index. - if (!added && loader_add_phys_dev_ext_table(inst, &idx, funcName)) { - added = true; + if (!loader_add_phys_dev_ext_table(inst, &idx, funcName)) { + // couldn't perform the above function due to insufficient memory available + goto out; } // Setup the ICD function pointers