Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 133176
b: refs/heads/master
c: 6ed9115
h: refs/heads/master
v: v3
  • Loading branch information
Clemens Ladisch authored and Takashi Iwai committed Feb 19, 2009
1 parent ac784c3 commit 763bb02
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 4 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: bb71858853a5c9616eea98512f4075d4f081154d
refs/heads/master: 6ed91157093c60e26bf0215b752f07af52935afc
14 changes: 11 additions & 3 deletions trunk/sound/pci/oxygen/oxygen_lib.c
Original file line number Diff line number Diff line change
Expand Up @@ -446,6 +446,7 @@ static void oxygen_card_free(struct snd_card *card)
free_irq(chip->irq, chip);
flush_scheduled_work();
chip->model.cleanup(chip);
kfree(chip->model_data);
mutex_destroy(&chip->mutex);
pci_release_regions(chip->pci);
pci_disable_device(chip->pci);
Expand All @@ -460,8 +461,7 @@ int oxygen_pci_probe(struct pci_dev *pci, int index, char *id,
struct oxygen *chip;
int err;

err = snd_card_create(index, id, owner,
sizeof(*chip) + model->model_data_size, &card);
err = snd_card_create(index, id, owner, sizeof(*chip), &card);
if (err < 0)
return err;

Expand All @@ -470,7 +470,6 @@ int oxygen_pci_probe(struct pci_dev *pci, int index, char *id,
chip->pci = pci;
chip->irq = -1;
chip->model = *model;
chip->model_data = chip + 1;
spin_lock_init(&chip->reg_lock);
mutex_init(&chip->mutex);
INIT_WORK(&chip->spdif_input_bits_work,
Expand All @@ -496,6 +495,15 @@ int oxygen_pci_probe(struct pci_dev *pci, int index, char *id,
}
chip->addr = pci_resource_start(pci, 0);

if (chip->model.model_data_size) {
chip->model_data = kmalloc(chip->model.model_data_size,
GFP_KERNEL);
if (!chip->model_data) {
err = -ENOMEM;
goto err_pci_regions;
}
}

pci_set_master(pci);
snd_card_set_dev(card, &pci->dev);
card->private_free = oxygen_card_free;
Expand Down

0 comments on commit 763bb02

Please sign in to comment.