lkml.org 
[lkml]   [2000]   [Oct]   [22]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: freeing memory
  It's not a fault of kernel, it's just a mistake.
you should use
for(i=0 to 9)
pAddr[10] only has a range of 0 to 9.
miic> f_malloc()
miic> {
miic> .....
miic> for (i=1 to 10)
miic> {
miic> size = 1000;
miic> pAddr[i] = (unsigned long) kmalloc(size, GFP_DMA | GFP_BUFFER);
miic> }
miic> ...
miic> }
miic> and freeing the allocated memory as follows

miic> f_free()
miic> {
miic> .....
miic> for (i=1 to 10)
miic> {
miic> kfree(pAddr[i]);
miic> }
miic> }
miic> pAddr is defined as 'unsigned long pAddr[10]'

miic> But when f_free executes i ran into problems and computer hangs.
miic> What can be the problem?????

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

\
 
 \ /
  Last update: 2005-03-22 12:41    [from the cache]
©2003-2011 Jasper Spaans