diff options
Diffstat (limited to 'sound/drivers/vx')
-rw-r--r-- | sound/drivers/vx/vx_pcm.c | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/sound/drivers/vx/vx_pcm.c b/sound/drivers/vx/vx_pcm.c index c4af84995d05..7e65a103fbb2 100644 --- a/sound/drivers/vx/vx_pcm.c +++ b/sound/drivers/vx/vx_pcm.c | |||
@@ -1252,18 +1252,15 @@ static int vx_init_audio_io(struct vx_core *chip) | |||
1252 | chip->audio_info = rmh.Stat[1]; | 1252 | chip->audio_info = rmh.Stat[1]; |
1253 | 1253 | ||
1254 | /* allocate pipes */ | 1254 | /* allocate pipes */ |
1255 | chip->playback_pipes = kmalloc(sizeof(struct vx_pipe *) * chip->audio_outs, GFP_KERNEL); | 1255 | chip->playback_pipes = kcalloc(chip->audio_outs, sizeof(struct vx_pipe *), GFP_KERNEL); |
1256 | if (!chip->playback_pipes) | 1256 | if (!chip->playback_pipes) |
1257 | return -ENOMEM; | 1257 | return -ENOMEM; |
1258 | chip->capture_pipes = kmalloc(sizeof(struct vx_pipe *) * chip->audio_ins, GFP_KERNEL); | 1258 | chip->capture_pipes = kcalloc(chip->audio_ins, sizeof(struct vx_pipe *), GFP_KERNEL); |
1259 | if (!chip->capture_pipes) { | 1259 | if (!chip->capture_pipes) { |
1260 | kfree(chip->playback_pipes); | 1260 | kfree(chip->playback_pipes); |
1261 | return -ENOMEM; | 1261 | return -ENOMEM; |
1262 | } | 1262 | } |
1263 | 1263 | ||
1264 | memset(chip->playback_pipes, 0, sizeof(struct vx_pipe *) * chip->audio_outs); | ||
1265 | memset(chip->capture_pipes, 0, sizeof(struct vx_pipe *) * chip->audio_ins); | ||
1266 | |||
1267 | preferred = chip->ibl.size; | 1264 | preferred = chip->ibl.size; |
1268 | chip->ibl.size = 0; | 1265 | chip->ibl.size = 0; |
1269 | vx_set_ibl(chip, &chip->ibl); /* query the info */ | 1266 | vx_set_ibl(chip, &chip->ibl); /* query the info */ |