X-Git-Url: https://git.karo-electronics.de/?a=blobdiff_plain;f=sound%2Fcore%2Fpcm_lib.c;h=a82e3756a72d8b95d49834e3ab61d08c6bf4d1d1;hb=e38302f78284e3e80ffc2eef54001fce7d183bd4;hp=fd18c3c6484f1169b5c6cfb34b96af7fa8c50632;hpb=c386735264da97e6b6d15aa56361e9ef188b26ab;p=mv-sheeva.git diff --git a/sound/core/pcm_lib.c b/sound/core/pcm_lib.c index fd18c3c6484..a82e3756a72 100644 --- a/sound/core/pcm_lib.c +++ b/sound/core/pcm_lib.c @@ -1092,8 +1092,10 @@ int snd_pcm_hw_rule_add(struct snd_pcm_runtime *runtime, unsigned int cond, struct snd_pcm_hw_rule *new; unsigned int new_rules = constrs->rules_all + 16; new = kcalloc(new_rules, sizeof(*c), GFP_KERNEL); - if (!new) + if (!new) { + va_end(args); return -ENOMEM; + } if (constrs->rules) { memcpy(new, constrs->rules, constrs->rules_num * sizeof(*c)); @@ -1109,8 +1111,10 @@ int snd_pcm_hw_rule_add(struct snd_pcm_runtime *runtime, unsigned int cond, c->private = private; k = 0; while (1) { - if (snd_BUG_ON(k >= ARRAY_SIZE(c->deps))) + if (snd_BUG_ON(k >= ARRAY_SIZE(c->deps))) { + va_end(args); return -EINVAL; + } c->deps[k++] = dep; if (dep < 0) break; @@ -1119,7 +1123,7 @@ int snd_pcm_hw_rule_add(struct snd_pcm_runtime *runtime, unsigned int cond, constrs->rules_num++; va_end(args); return 0; -} +} EXPORT_SYMBOL(snd_pcm_hw_rule_add);