kernel memory allocation

João Eduardo Luís jecluis at gmail.com
Fri Jun 3 16:46:28 EDT 2011


Hello,

Once again, I would pretty much enjoy if you CC'ed the list on replies.


On Jun 3, 2011, at 8:49 PM, Amirali Shambayati wrote:

> I set breakpoint before kmalloc. panic happens after kmalloc.
> 
>> 2011/6/4 Amirali Shambayati <amirali.shambayati at gmail.com>
>> ofcourse it's null before allocate it. I make an instantiation of it. then  I want to allocate memory for it.What else I should do?

I meant, are you checking if 'newBun' is NULL _AFTER_ the kmalloc?

The kmalloc call will return NULL instead of a pointer to newly allocated memory whenever an error occurs. If by any chance you are not checking if 'newBun' is NULL after the kmalloc, then you should do it.

Also, if the panic happens _after_ the kmalloc, and not _during_ the kmalloc, I would say there's a slim chance of kmalloc being the cause of the panic.


---
João Eduardo Luís
gpg key: 477C26E5 from pool.keyserver.eu 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: PGP.sig
Type: application/pgp-signature
Size: 495 bytes
Desc: This is a digitally signed message part
Url : http://lists.kernelnewbies.org/pipermail/kernelnewbies/attachments/20110603/dac98d86/attachment.bin 


More information about the Kernelnewbies mailing list