Messages in this thread | | | Date | Sun, 22 Oct 2000 17:10:02 +0800 | From | Bordi Zhou <> | Subject | Re: 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/
| |