Re: insmod segfault in pci_find_subsys()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Greg KH wrote:

On Fri, Mar 18, 2005 at 10:12:05AM +0100, Toralf Lund wrote:
Am I seeing an issue with the PCI functions here, or is it just that I fail to spot an obvious mistake in the module itself?

I think it's a problem in your code.  I built and ran the following
example module just fine (based on your example, which wasn't the
smallest or cleanest...), with no oops.  Does this code work for you?
OK, I've finally been able to test this, and no, it does not work. insmod segfaults and the system log says

kernel: Unable to handle kernel paging request at virtual address 533e3762



Oh, and the pci_find* functions are depreciated, do not use them, they
are going away in the near future.  Please use the pci_get* functions
instead.

thanks,

greg k-h

-----------------
#include <linux/pci.h>
#include <linux/module.h>

MODULE_LICENSE("GPL");

	
static void __exit exit(void)
{ }

static __init int init(void)
{
	struct pci_dev *dev;

	printk(KERN_DEBUG "Scanning all devices...\n");

	dev = NULL;
	while ((dev = pci_find_device(PCI_ANY_ID, PCI_ANY_ID, dev))) {
		printk(KERN_DEBUG "Device %04hx:%04hx\n",
			dev->vendor, dev->device);
	}
	return 0;
}

module_init(init);
module_exit(exit);

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[Index of Archives]     [Kernel Newbies]     [Netfilter]     [Bugtraq]     [Photo]     [Stuff]     [Gimp]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Video 4 Linux]     [Linux for the blind]     [Linux Resources]
  Powered by Linux