PATCH: emu10k1 moving pci_enable_device

From: Marcus Meissner (Marcus.Meissner@caldera.de)
Date: Wed May 02 2001 - 01:44:25 EST


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/



This archive was generated by hypermail 2b29 : Mon May 07 2001 - 21:00:12 EST