diff options
Diffstat (limited to 'sound/oss/emu10k1/main.c')
-rw-r--r-- | sound/oss/emu10k1/main.c | 11 |
1 files changed, 3 insertions, 8 deletions
diff --git a/sound/oss/emu10k1/main.c b/sound/oss/emu10k1/main.c index 6c59df7b0001..16ac02540a3f 100644 --- a/sound/oss/emu10k1/main.c +++ b/sound/oss/emu10k1/main.c | |||
@@ -455,15 +455,13 @@ static int __devinit emu10k1_midi_init(struct emu10k1_card *card) | |||
455 | { | 455 | { |
456 | int ret; | 456 | int ret; |
457 | 457 | ||
458 | card->mpuout = kmalloc(sizeof(struct emu10k1_mpuout), GFP_KERNEL); | 458 | card->mpuout = kzalloc(sizeof(struct emu10k1_mpuout), GFP_KERNEL); |
459 | if (card->mpuout == NULL) { | 459 | if (card->mpuout == NULL) { |
460 | printk(KERN_WARNING "emu10k1: Unable to allocate emu10k1_mpuout: out of memory\n"); | 460 | printk(KERN_WARNING "emu10k1: Unable to allocate emu10k1_mpuout: out of memory\n"); |
461 | ret = -ENOMEM; | 461 | ret = -ENOMEM; |
462 | goto err_out1; | 462 | goto err_out1; |
463 | } | 463 | } |
464 | 464 | ||
465 | memset(card->mpuout, 0, sizeof(struct emu10k1_mpuout)); | ||
466 | |||
467 | card->mpuout->intr = 1; | 465 | card->mpuout->intr = 1; |
468 | card->mpuout->status = FLAGS_AVAILABLE; | 466 | card->mpuout->status = FLAGS_AVAILABLE; |
469 | card->mpuout->state = CARDMIDIOUT_STATE_DEFAULT; | 467 | card->mpuout->state = CARDMIDIOUT_STATE_DEFAULT; |
@@ -472,15 +470,13 @@ static int __devinit emu10k1_midi_init(struct emu10k1_card *card) | |||
472 | 470 | ||
473 | spin_lock_init(&card->mpuout->lock); | 471 | spin_lock_init(&card->mpuout->lock); |
474 | 472 | ||
475 | card->mpuin = kmalloc(sizeof(struct emu10k1_mpuin), GFP_KERNEL); | 473 | card->mpuin = kzalloc(sizeof(struct emu10k1_mpuin), GFP_KERNEL); |
476 | if (card->mpuin == NULL) { | 474 | if (card->mpuin == NULL) { |
477 | printk(KERN_WARNING "emu10k1: Unable to allocate emu10k1_mpuin: out of memory\n"); | 475 | printk(KERN_WARNING "emu10k1: Unable to allocate emu10k1_mpuin: out of memory\n"); |
478 | ret = -ENOMEM; | 476 | ret = -ENOMEM; |
479 | goto err_out2; | 477 | goto err_out2; |
480 | } | 478 | } |
481 | 479 | ||
482 | memset(card->mpuin, 0, sizeof(struct emu10k1_mpuin)); | ||
483 | |||
484 | card->mpuin->status = FLAGS_AVAILABLE; | 480 | card->mpuin->status = FLAGS_AVAILABLE; |
485 | 481 | ||
486 | tasklet_init(&card->mpuin->tasklet, emu10k1_mpuin_bh, (unsigned long) card->mpuin); | 482 | tasklet_init(&card->mpuin->tasklet, emu10k1_mpuin_bh, (unsigned long) card->mpuin); |
@@ -1280,11 +1276,10 @@ static int __devinit emu10k1_probe(struct pci_dev *pci_dev, const struct pci_dev | |||
1280 | 1276 | ||
1281 | pci_set_master(pci_dev); | 1277 | pci_set_master(pci_dev); |
1282 | 1278 | ||
1283 | if ((card = kmalloc(sizeof(struct emu10k1_card), GFP_KERNEL)) == NULL) { | 1279 | if ((card = kzalloc(sizeof(struct emu10k1_card), GFP_KERNEL)) == NULL) { |
1284 | printk(KERN_ERR "emu10k1: out of memory\n"); | 1280 | printk(KERN_ERR "emu10k1: out of memory\n"); |
1285 | return -ENOMEM; | 1281 | return -ENOMEM; |
1286 | } | 1282 | } |
1287 | memset(card, 0, sizeof(struct emu10k1_card)); | ||
1288 | 1283 | ||
1289 | card->iobase = pci_resource_start(pci_dev, 0); | 1284 | card->iobase = pci_resource_start(pci_dev, 0); |
1290 | card->length = pci_resource_len(pci_dev, 0); | 1285 | card->length = pci_resource_len(pci_dev, 0); |