]> git.alsa-project.org Git - alsa-lib.git/commitdiff
Added missing variable initialization in open_conf() functions (hwdep, timer); Uros
authorJaroslav Kysela <perex@perex.cz>
Thu, 27 Dec 2001 20:55:53 +0000 (20:55 +0000)
committerJaroslav Kysela <perex@perex.cz>
Thu, 27 Dec 2001 20:55:53 +0000 (20:55 +0000)
src/hwdep/hwdep.c
src/seq/seq.c
src/timer/timer.c
src/timer/timer_query.c

index cba186b5ef68262fb0a0adfafe318a68e434bf2f..95b18e28061f6af778cbd2d3e001da2ebe0056b5 100644 (file)
@@ -119,6 +119,7 @@ static int snd_hwdep_open_conf(snd_hwdep_t **hwdep,
        h = snd_dlopen(lib, RTLD_NOW);
        if (h)
                open_func = snd_dlsym(h, open_name, SND_DLSYM_VERSION(SND_HWDEP_DLSYM_VERSION));
+       err = 0;
        if (!h) {
                SNDERR("Cannot open shared library %s", lib);
                err = -ENOENT;
@@ -130,11 +131,7 @@ static int snd_hwdep_open_conf(snd_hwdep_t **hwdep,
        _err:
        if (type_conf)
                snd_config_delete(type_conf);
-       if (err >= 0)
-               err = open_func(hwdep, name, hwdep_root, hwdep_conf, mode);
-       if (err < 0)
-               return err;
-       return 0;
+       return err >= 0 ? open_func(hwdep, name, hwdep_root, hwdep_conf, mode) : err;
 }
 
 static int snd_hwdep_open_noupdate(snd_hwdep_t **hwdep, snd_config_t *root, const char *name, int mode)
index 26c5fede8bfa652ee8fc146ee4ef830f91415c72..75fbb89cfe1a2932578cb562e1119d93b772d44f 100644 (file)
@@ -134,6 +134,8 @@ static int snd_seq_open_conf(snd_seq_t **seqp, const char *name,
                                continue;
                        }
                        SNDERR("Unknown field %s", id);
+                       err = -EINVAL;
+                       goto _err;
                }
        }
        if (!open_name) {
index 352c10e3fb003800bea28543b38ece28e36fd678..c08d44a6c05f49a30dae48dc15622e62da9abd5e 100644 (file)
@@ -130,11 +130,7 @@ static int snd_timer_open_conf(snd_timer_t **timer,
        _err:
        if (type_conf)
                snd_config_delete(type_conf);
-       if (err >= 0)
-               err = open_func(timer, name, timer_root, timer_conf, mode);
-       if (err < 0)
-               return err;
-       return 0;
+       return err >= 0 ? open_func(timer, name, timer_root, timer_conf, mode) : err;
 }
 
 static int snd_timer_open_noupdate(snd_timer_t **timer, snd_config_t *root, const char *name, int mode)
index 121c77e300bffa4c2890b9cbc7939cc334294efa..2afab11a49066aa7695e510a36e981323e66b4f0 100644 (file)
@@ -117,6 +117,7 @@ static int snd_timer_query_open_conf(snd_timer_query_t **timer,
        h = snd_dlopen(lib, RTLD_NOW);
        if (h)
                open_func = snd_dlsym(h, open_name, SND_DLSYM_VERSION(SND_TIMER_QUERY_DLSYM_VERSION));
+       err = 0;
        if (!h) {
                SNDERR("Cannot open shared library %s", lib);
                err = -ENOENT;
@@ -128,11 +129,7 @@ static int snd_timer_query_open_conf(snd_timer_query_t **timer,
        _err:
        if (type_conf)
                snd_config_delete(type_conf);
-       if (err >= 0)
-               err = open_func(timer, name, timer_root, timer_conf, mode);
-       if (err < 0)
-               return err;
-       return 0;
+       return err >= 0 ? open_func(timer, name, timer_root, timer_conf, mode) : err;
 }
 
 static int snd_timer_query_open_noupdate(snd_timer_query_t **timer, snd_config_t *root, const char *name, int mode)