diff options
author | Takashi Iwai <tiwai@suse.de> | 2018-04-02 13:50:41 -0400 |
---|---|---|
committer | Takashi Iwai <tiwai@suse.de> | 2018-04-02 13:50:59 -0400 |
commit | bc334cb61b9ee6e85b9bb01519989a3ae8fe03f6 (patch) | |
tree | 34424a812537fe11beeee727b30b19c67193fe36 /sound/core/pcm_lib.c | |
parent | 5607dddbfca774fb38bffadcb077fe03aa4ac5c6 (diff) | |
parent | b44d419b98fae759b4f746186b1d1c8d01d962f2 (diff) |
Merge branch 'for-next' into for-linus
Preparation for 4.17 merge.
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound/core/pcm_lib.c')
-rw-r--r-- | sound/core/pcm_lib.c | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/sound/core/pcm_lib.c b/sound/core/pcm_lib.c index a83152e7d387..f4a19509cccf 100644 --- a/sound/core/pcm_lib.c +++ b/sound/core/pcm_lib.c | |||
@@ -1129,16 +1129,12 @@ int snd_pcm_hw_rule_add(struct snd_pcm_runtime *runtime, unsigned int cond, | |||
1129 | if (constrs->rules_num >= constrs->rules_all) { | 1129 | if (constrs->rules_num >= constrs->rules_all) { |
1130 | struct snd_pcm_hw_rule *new; | 1130 | struct snd_pcm_hw_rule *new; |
1131 | unsigned int new_rules = constrs->rules_all + 16; | 1131 | unsigned int new_rules = constrs->rules_all + 16; |
1132 | new = kcalloc(new_rules, sizeof(*c), GFP_KERNEL); | 1132 | new = krealloc(constrs->rules, new_rules * sizeof(*c), |
1133 | GFP_KERNEL); | ||
1133 | if (!new) { | 1134 | if (!new) { |
1134 | va_end(args); | 1135 | va_end(args); |
1135 | return -ENOMEM; | 1136 | return -ENOMEM; |
1136 | } | 1137 | } |
1137 | if (constrs->rules) { | ||
1138 | memcpy(new, constrs->rules, | ||
1139 | constrs->rules_num * sizeof(*c)); | ||
1140 | kfree(constrs->rules); | ||
1141 | } | ||
1142 | constrs->rules = new; | 1138 | constrs->rules = new; |
1143 | constrs->rules_all = new_rules; | 1139 | constrs->rules_all = new_rules; |
1144 | } | 1140 | } |