Re: array size limit in module?

Benjamin LaHaise (bcrl@redhat.com)
Thu, 10 Jan 2002 13:37:56 -0500


On Thu, Jan 10, 2002 at 01:18:35PM -0500, Brian Gerst wrote:
> Use vmalloc for allocations that large, unless you must have the memory
> physically contiguous. 128k is the largest amount of memory you can
> allocate with kmalloc.

Even before he uses vmalloc, he should take a programming 101 course that
explains the importance of error checking. kmalloc returned NULL, the
code didn't handle the case. Switching to vmalloc will only make the code
usually work, but still susceptible to crashing.

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