lkml.org 
[lkml]   [2001]   [May]   [2]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
SubjectPATCH: emu10k1 moving pci_enable_device
Hi,

This moves pci_enable_device in emu10k1 driver before any resource
access.

Ciao, Marcus

Index: main.c
===================================================================
RCS file: /build/mm/work/repository/linux-mm/drivers/sound/emu10k1/main.c,v
retrieving revision 1.3
diff -u -r1.3 linux-mm/drivers/sound/emu10k1/main.c
--- linux-vanilla/drivers/sound/emu10k1/main.c 2001/04/17 16:55:42 1.3
+++ linux-mm/drivers/sound/emu10k1/main.c 2001/04/25 11:25:02
@@ -612,7 +612,11 @@
{
struct emu10k1_card *card;
u32 subsysvid;
+ int ret;

+ if ((ret=pci_enable_device(pci_dev)))
+ return ret;
+
if ((card = kmalloc(sizeof(struct emu10k1_card), GFP_KERNEL)) == NULL) {
printk(KERN_ERR "emu10k1: out of memory\n");
return -ENOMEM;
@@ -621,11 +625,6 @@

if (pci_set_dma_mask(pci_dev, EMU10K1_DMA_MASK)) {
printk(KERN_ERR "emu10k1: architecture does not support 32bit PCI busmaster DMA\n");
- kfree(card);
- return -ENODEV;
- }
-
- if (pci_enable_device(pci_dev)) {
kfree(card);
return -ENODEV;
}
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
\
 
 \ /
  Last update: 2005-03-22 12:52    [W:0.026 / U:2.340 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site