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

Re: Stack overflow problem in kernel module



On Mon, Jan 10, 2005 at 12:30:46PM +0530, Karthik Subramanian wrote:
> 1. Why is it a bad idea to use huge local arrays in kernel modules?

Because your kernel stack is very small. 4Kb.  If you need a large
array, either make it static (not on the stack) or dynamically allocate
it (with kmalloc.)

Hope this helps,

greg k-h

--
Kernelnewbies: Help each other learn about the Linux kernel.
Archive:       http://mail.nl.linux.org/kernelnewbies/
FAQ:           http://kernelnewbies.org/faq/