diff options
author | Robert P. J. Day <rpjday@mindspring.com> | 2007-02-14 03:33:16 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2007-02-14 11:09:54 -0500 |
commit | 3159f06dc2303630c02d1ad2eeaeaf341414c9df (patch) | |
tree | 678779f605dac635df3932381933b3950a0052ba /sound/oss/trident.c | |
parent | cd354f1ae75e6466a7e31b727faede57a1f89ca5 (diff) |
[PATCH] OSS: replace kmalloc()+memset() combos with kzalloc()
Replace kmalloc() + memset() pairs with the appropriate kzalloc() calls.
Signed-off-by: Robert P. J. Day <rpjday@mindspring.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'sound/oss/trident.c')
-rw-r--r-- | sound/oss/trident.c | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/sound/oss/trident.c b/sound/oss/trident.c index 6b1f8c9cdcf8..72a8a0ed36a2 100644 --- a/sound/oss/trident.c +++ b/sound/oss/trident.c | |||
@@ -2729,12 +2729,11 @@ trident_open(struct inode *inode, struct file *file) | |||
2729 | } | 2729 | } |
2730 | for (i = 0; i < NR_HW_CH; i++) { | 2730 | for (i = 0; i < NR_HW_CH; i++) { |
2731 | if (card->states[i] == NULL) { | 2731 | if (card->states[i] == NULL) { |
2732 | state = card->states[i] = kmalloc(sizeof(*state), GFP_KERNEL); | 2732 | state = card->states[i] = kzalloc(sizeof(*state), GFP_KERNEL); |
2733 | if (state == NULL) { | 2733 | if (state == NULL) { |
2734 | mutex_unlock(&card->open_mutex); | 2734 | mutex_unlock(&card->open_mutex); |
2735 | return -ENOMEM; | 2735 | return -ENOMEM; |
2736 | } | 2736 | } |
2737 | memset(state, 0, sizeof(*state)); | ||
2738 | mutex_init(&state->sem); | 2737 | mutex_init(&state->sem); |
2739 | dmabuf = &state->dmabuf; | 2738 | dmabuf = &state->dmabuf; |
2740 | goto found_virt; | 2739 | goto found_virt; |
@@ -3618,7 +3617,7 @@ ali_allocate_other_states_resources(struct trident_state *state, int chan_nums) | |||
3618 | } | 3617 | } |
3619 | return -EBUSY; | 3618 | return -EBUSY; |
3620 | } | 3619 | } |
3621 | s = card->states[i] = kmalloc(sizeof(*state), GFP_KERNEL); | 3620 | s = card->states[i] = kzalloc(sizeof(*state), GFP_KERNEL); |
3622 | if (!s) { | 3621 | if (!s) { |
3623 | num = ali_multi_channels_5_1[state_count]; | 3622 | num = ali_multi_channels_5_1[state_count]; |
3624 | ali_free_pcm_channel(card, num); | 3623 | ali_free_pcm_channel(card, num); |
@@ -3630,7 +3629,6 @@ ali_allocate_other_states_resources(struct trident_state *state, int chan_nums) | |||
3630 | } | 3629 | } |
3631 | return -ENOMEM; | 3630 | return -ENOMEM; |
3632 | } | 3631 | } |
3633 | memset(s, 0, sizeof(*state)); | ||
3634 | 3632 | ||
3635 | s->dmabuf.channel = channel; | 3633 | s->dmabuf.channel = channel; |
3636 | s->dmabuf.ossfragshift = s->dmabuf.ossmaxfrags = | 3634 | s->dmabuf.ossfragshift = s->dmabuf.ossmaxfrags = |
@@ -4399,11 +4397,10 @@ trident_probe(struct pci_dev *pci_dev, const struct pci_device_id *pci_id) | |||
4399 | } | 4397 | } |
4400 | 4398 | ||
4401 | rc = -ENOMEM; | 4399 | rc = -ENOMEM; |
4402 | if ((card = kmalloc(sizeof(*card), GFP_KERNEL)) == NULL) { | 4400 | if ((card = kzalloc(sizeof(*card), GFP_KERNEL)) == NULL) { |
4403 | printk(KERN_ERR "trident: out of memory\n"); | 4401 | printk(KERN_ERR "trident: out of memory\n"); |
4404 | goto out_release_region; | 4402 | goto out_release_region; |
4405 | } | 4403 | } |
4406 | memset(card, 0, sizeof (*card)); | ||
4407 | 4404 | ||
4408 | init_timer(&card->timer); | 4405 | init_timer(&card->timer); |
4409 | card->iobase = iobase; | 4406 | card->iobase = iobase; |