diff options
author | Alan Cox <alan@lxorguk.ukuu.org.uk> | 2006-10-01 02:27:26 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2006-10-01 03:39:20 -0400 |
commit | 14fef6414be49d59f4784eeef8d9c3f468993205 (patch) | |
tree | 5b30d0df89584a2a7abea19c558b62db57570479 | |
parent | f2443ab6c485701576e9116ee44817e66adafd5a (diff) |
[PATCH] via82cxxx_audio: Use pci_get_device
pci_find_device is not refcounting and should be getting killed off.
Signed-off-by: Alan Cox <alan@redhat.com>
Cc: Greg KH <greg@kroah.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
-rw-r--r-- | sound/oss/via82cxxx_audio.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/sound/oss/via82cxxx_audio.c b/sound/oss/via82cxxx_audio.c index 08d8c94d01b2..2fec42fc3482 100644 --- a/sound/oss/via82cxxx_audio.c +++ b/sound/oss/via82cxxx_audio.c | |||
@@ -1547,7 +1547,7 @@ static int via_mixer_open (struct inode *inode, struct file *file) | |||
1547 | 1547 | ||
1548 | DPRINTK ("ENTER\n"); | 1548 | DPRINTK ("ENTER\n"); |
1549 | 1549 | ||
1550 | while ((pdev = pci_find_device(PCI_ANY_ID, PCI_ANY_ID, pdev)) != NULL) { | 1550 | while ((pdev = pci_get_device(PCI_ANY_ID, PCI_ANY_ID, pdev)) != NULL) { |
1551 | drvr = pci_dev_driver (pdev); | 1551 | drvr = pci_dev_driver (pdev); |
1552 | if (drvr == &via_driver) { | 1552 | if (drvr == &via_driver) { |
1553 | assert (pci_get_drvdata (pdev) != NULL); | 1553 | assert (pci_get_drvdata (pdev) != NULL); |
@@ -1562,6 +1562,7 @@ static int via_mixer_open (struct inode *inode, struct file *file) | |||
1562 | return -ENODEV; | 1562 | return -ENODEV; |
1563 | 1563 | ||
1564 | match: | 1564 | match: |
1565 | pci_dev_put(pdev); | ||
1565 | file->private_data = card->ac97; | 1566 | file->private_data = card->ac97; |
1566 | 1567 | ||
1567 | DPRINTK ("EXIT, returning 0\n"); | 1568 | DPRINTK ("EXIT, returning 0\n"); |
@@ -3245,7 +3246,7 @@ static int via_dsp_open (struct inode *inode, struct file *file) | |||
3245 | } | 3246 | } |
3246 | 3247 | ||
3247 | card = NULL; | 3248 | card = NULL; |
3248 | while ((pdev = pci_find_device(PCI_ANY_ID, PCI_ANY_ID, pdev)) != NULL) { | 3249 | while ((pdev = pci_get_device(PCI_ANY_ID, PCI_ANY_ID, pdev)) != NULL) { |
3249 | drvr = pci_dev_driver (pdev); | 3250 | drvr = pci_dev_driver (pdev); |
3250 | if (drvr == &via_driver) { | 3251 | if (drvr == &via_driver) { |
3251 | assert (pci_get_drvdata (pdev) != NULL); | 3252 | assert (pci_get_drvdata (pdev) != NULL); |
@@ -3264,6 +3265,7 @@ static int via_dsp_open (struct inode *inode, struct file *file) | |||
3264 | return -ENODEV; | 3265 | return -ENODEV; |
3265 | 3266 | ||
3266 | match: | 3267 | match: |
3268 | pci_dev_put(pdev); | ||
3267 | if (nonblock) { | 3269 | if (nonblock) { |
3268 | if (!mutex_trylock(&card->open_mutex)) { | 3270 | if (!mutex_trylock(&card->open_mutex)) { |
3269 | DPRINTK ("EXIT, returning -EAGAIN\n"); | 3271 | DPRINTK ("EXIT, returning -EAGAIN\n"); |