eal: suppress error log on multi-process hotplug
[dpdk.git] / lib / eal / common / eal_common_options.c
index 66f9114..ff5861b 100644 (file)
@@ -509,10 +509,14 @@ is_shared_build(void)
        }
 
        while (len >= minlen) {
+               void *handle;
+
                /* check if we have this .so loaded, if so - shared build */
                RTE_LOG(DEBUG, EAL, "Checking presence of .so '%s'\n", soname);
-               if (dlopen(soname, RTLD_LAZY | RTLD_NOLOAD) != NULL) {
+               handle = dlopen(soname, RTLD_LAZY | RTLD_NOLOAD);
+               if (handle != NULL) {
                        RTE_LOG(INFO, EAL, "Detected shared linkage of DPDK\n");
+                       dlclose(handle);
                        return 1;
                }
 
@@ -758,10 +762,10 @@ static int
 eal_parse_service_corelist(const char *corelist)
 {
        struct rte_config *cfg = rte_eal_get_configuration();
-       int i, idx = 0;
+       int i;
        unsigned count = 0;
        char *end = NULL;
-       int min, max;
+       uint32_t min, max, idx;
        uint32_t taken_lcore_count = 0;
 
        if (corelist == NULL)
@@ -785,6 +789,8 @@ eal_parse_service_corelist(const char *corelist)
                idx = strtoul(corelist, &end, 10);
                if (errno || end == NULL)
                        return -1;
+               if (idx >= RTE_MAX_LCORE)
+                       return -1;
                while (isblank(*end))
                        end++;
                if (*end == '-') {