summaryrefslogtreecommitdiff
path: root/sound/core/pcm_lib.c
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2018-04-02 19:50:41 +0200
committerTakashi Iwai <tiwai@suse.de>2018-04-02 19:50:59 +0200
commitbc334cb61b9ee6e85b9bb01519989a3ae8fe03f6 (patch)
tree34424a812537fe11beeee727b30b19c67193fe36 /sound/core/pcm_lib.c
parent5607dddbfca774fb38bffadcb077fe03aa4ac5c6 (diff)
parentb44d419b98fae759b4f746186b1d1c8d01d962f2 (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.c8
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,
if (constrs->rules_num >= constrs->rules_all) {
struct snd_pcm_hw_rule *new;
unsigned int new_rules = constrs->rules_all + 16;
- new = kcalloc(new_rules, sizeof(*c), GFP_KERNEL);
+ new = krealloc(constrs->rules, new_rules * sizeof(*c),
+ GFP_KERNEL);
if (!new) {
va_end(args);
return -ENOMEM;
}
- if (constrs->rules) {
- memcpy(new, constrs->rules,
- constrs->rules_num * sizeof(*c));
- kfree(constrs->rules);
- }
constrs->rules = new;
constrs->rules_all = new_rules;
}