[PATCH] update kfree, vfree, and vunmap kerneldoc
authorPekka Enberg <penberg@cs.helsinki.fi>
Fri, 9 Sep 2005 20:10:16 +0000 (13:10 -0700)
committerLinus Torvalds <torvalds@g5.osdl.org>
Fri, 9 Sep 2005 21:03:43 +0000 (14:03 -0700)
This patch clarifies NULL handling of kfree() and vfree().  I addition,
wording of calling context restriction for vfree() and vunmap() are changed
from "may not" to "must not."

Signed-off-by: Pekka Enberg <penberg@cs.helsinki.fi>
Acked-by: Manfred Spraul <manfred@colorfullife.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
mm/slab.c
mm/vmalloc.c

index a041c53..05a3910 100644 (file)
--- a/mm/slab.c
+++ b/mm/slab.c
@@ -2998,6 +2998,8 @@ EXPORT_SYMBOL(kzalloc);
  * kfree - free previously allocated memory
  * @objp: pointer returned by kmalloc.
  *
+ * If @objp is NULL, no operation is performed.
+ *
  * Don't free memory not originally allocated by kmalloc()
  * or you will run into trouble.
  */
index 67b358e..13c3d82 100644 (file)
@@ -332,9 +332,10 @@ void __vunmap(void *addr, int deallocate_pages)
  *     @addr:          memory base address
  *
  *     Free the virtually contiguous memory area starting at @addr, as
- *     obtained from vmalloc(), vmalloc_32() or __vmalloc().
+ *     obtained from vmalloc(), vmalloc_32() or __vmalloc(). If @addr is
+ *     NULL, no operation is performed.
  *
- *     May not be called in interrupt context.
+ *     Must not be called in interrupt context.
  */
 void vfree(void *addr)
 {
@@ -352,7 +353,7 @@ EXPORT_SYMBOL(vfree);
  *     Free the virtually contiguous memory area starting at @addr,
  *     which was created from the page array passed to vmap().
  *
- *     May not be called in interrupt context.
+ *     Must not be called in interrupt context.
  */
 void vunmap(void *addr)
 {