Commit 80e93eff authored by Pekka Enberg's avatar Pekka Enberg Committed by Linus Torvalds

[PATCH] update kfree, vfree, and vunmap kerneldoc

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: default avatarPekka Enberg <penberg@cs.helsinki.fi>
Acked-by: default avatarManfred Spraul <manfred@colorfullife.com>
Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent af97c722
...@@ -2998,6 +2998,8 @@ EXPORT_SYMBOL(kzalloc); ...@@ -2998,6 +2998,8 @@ EXPORT_SYMBOL(kzalloc);
* kfree - free previously allocated memory * kfree - free previously allocated memory
* @objp: pointer returned by kmalloc. * @objp: pointer returned by kmalloc.
* *
* If @objp is NULL, no operation is performed.
*
* Don't free memory not originally allocated by kmalloc() * Don't free memory not originally allocated by kmalloc()
* or you will run into trouble. * or you will run into trouble.
*/ */
......
...@@ -332,9 +332,10 @@ void __vunmap(void *addr, int deallocate_pages) ...@@ -332,9 +332,10 @@ void __vunmap(void *addr, int deallocate_pages)
* @addr: memory base address * @addr: memory base address
* *
* Free the virtually contiguous memory area starting at @addr, as * 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) void vfree(void *addr)
{ {
...@@ -352,7 +353,7 @@ EXPORT_SYMBOL(vfree); ...@@ -352,7 +353,7 @@ EXPORT_SYMBOL(vfree);
* Free the virtually contiguous memory area starting at @addr, * Free the virtually contiguous memory area starting at @addr,
* which was created from the page array passed to vmap(). * 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) void vunmap(void *addr)
{ {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment