Messages in this thread |  | | | Date | Wed, 30 Mar 2011 09:23:07 -0600 | | From | Jonathan Corbet <> | | Subject | Re: Help with dma on PCI driver |
| |
On Wed, 30 Mar 2011 07:07:32 -0300 Luis Filipe Rossi <luisf.rossi@gmail.com> wrote:
> I am developing a driver for a custom PCI board. I am following the > example on Essential Linux Device Drivers, but when i am calling the > pci_alloc_consitent i get the following error: > Mar 29 15:18:42 luis-desktop kernel: [ 4520.075823] BUG: unable to > handle kernel NULL pointer dereference at 00000004
Your source was horribly mangled, which is likely to reduce the number of responses you get. I've not had the time to look at it in great detail, but I will say that the assumption that the PCI device is already probed and registered immediately after the pci_register_driver() call is dangerous at best. Things like dma_descriptor_setup() should be called in your probe routine (or even later, when you actually need the buffer) rather than in your module init function.
There's a lot of other issues with this driver, but that's the one I would look first at for the resolution of this particular crash.
jon
|  |