public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Greg KH <gregkh@suse.de>
To: Toralf Lund <toralf@procaptura.com>
Cc: linux-kernel@vger.kernel.org
Subject: Re: insmod segfault in pci_find_subsys()
Date: Fri, 18 Mar 2005 09:07:09 -0800	[thread overview]
Message-ID: <20050318170709.GD14952@kroah.com> (raw)
In-Reply-To: <423A9B65.1020103@procaptura.com>

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?

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);


  reply	other threads:[~2005-03-18 17:08 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-03-18  9:12 insmod segfault in pci_find_subsys() Toralf Lund
2005-03-18 17:07 ` Greg KH [this message]
2005-03-19 12:28   ` Toralf Lund
2005-03-29 14:15   ` Toralf Lund
2005-04-13  7:12     ` Greg KH
2005-04-13 11:00       ` Toralf Lund
2005-04-13 11:13         ` Arjan van de Ven
2005-04-13 11:49           ` Toralf Lund
2005-04-13 13:27             ` Sam Ravnborg
2005-04-18  7:20               ` Toralf Lund

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20050318170709.GD14952@kroah.com \
    --to=gregkh@suse.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=toralf@procaptura.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox