Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 257623
b: refs/heads/master
c: 3101ba0
h: refs/heads/master
i:
  257621: 2e6a1a1
  257619: d8f6562
  257615: c696be6
v: v3
  • Loading branch information
Takashi Iwai committed Jul 12, 2011
1 parent ab1c145 commit 5c30a53
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 11 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 08ef79490dad6b88010e94795cf9f89b018ed504
refs/heads/master: 3101ba035ca9ba92f6cec7fd37348646b7a5cb61
8 changes: 4 additions & 4 deletions trunk/sound/core/rawmidi.c
Original file line number Diff line number Diff line change
Expand Up @@ -626,10 +626,10 @@ int snd_rawmidi_output_params(struct snd_rawmidi_substream *substream,
return -EINVAL;
}
if (params->buffer_size != runtime->buffer_size) {
newbuf = kmalloc(params->buffer_size, GFP_KERNEL);
newbuf = krealloc(runtime->buffer, params->buffer_size,
GFP_KERNEL);
if (!newbuf)
return -ENOMEM;
kfree(runtime->buffer);
runtime->buffer = newbuf;
runtime->buffer_size = params->buffer_size;
runtime->avail = runtime->buffer_size;
Expand All @@ -653,10 +653,10 @@ int snd_rawmidi_input_params(struct snd_rawmidi_substream *substream,
return -EINVAL;
}
if (params->buffer_size != runtime->buffer_size) {
newbuf = kmalloc(params->buffer_size, GFP_KERNEL);
newbuf = krealloc(runtime->buffer, params->buffer_size,
GFP_KERNEL);
if (!newbuf)
return -ENOMEM;
kfree(runtime->buffer);
runtime->buffer = newbuf;
runtime->buffer_size = params->buffer_size;
}
Expand Down
9 changes: 3 additions & 6 deletions trunk/sound/pci/hda/hda_codec.c
Original file line number Diff line number Diff line change
Expand Up @@ -4957,17 +4957,14 @@ void *snd_array_new(struct snd_array *array)
{
if (array->used >= array->alloced) {
int num = array->alloced + array->alloc_align;
int size = (num + 1) * array->elem_size;
void *nlist;
if (snd_BUG_ON(num >= 4096))
return NULL;
nlist = kcalloc(num + 1, array->elem_size, GFP_KERNEL);
nlist = krealloc(array->list, size, GFP_KERNEL);
if (!nlist)
return NULL;
if (array->list) {
memcpy(nlist, array->list,
array->elem_size * array->alloced);
kfree(array->list);
}
memset(nlist, 0, size - array->alloced * array->elem_size);
array->list = nlist;
array->alloced = num;
}
Expand Down

0 comments on commit 5c30a53

Please sign in to comment.