public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] Document kfree and vfree NULL usage (resend)
@ 2004-12-03 19:48 Pekka Enberg
  2004-12-05 15:33 ` Manfred Spraul
  0 siblings, 1 reply; 11+ messages in thread
From: Pekka Enberg @ 2004-12-03 19:48 UTC (permalink / raw)
  To: akpm; +Cc: manfred, linux-kernel

Hi,

This patch adds comments for kfree() and vfree() stating that both accept
NULL pointers.

Signed-off-by: Pekka Enberg <penberg@cs.helsinki.fi>
---

 slab.c    |    2 ++
 vmalloc.c |    3 ++-
 2 files changed, 4 insertions(+), 1 deletion(-)

Index: 2.6.10-rc2/mm/slab.c
===================================================================
--- 2.6.10-rc2.orig/mm/slab.c	2004-11-27 14:33:14.000000000 +0200
+++ 2.6.10-rc2/mm/slab.c	2004-11-27 16:12:54.573387384 +0200
@@ -2535,6 +2535,8 @@
  * 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: 2.6.10-rc2/mm/vmalloc.c
===================================================================
--- 2.6.10-rc2.orig/mm/vmalloc.c	2004-11-27 16:13:48.026261312 +0200
+++ 2.6.10-rc2/mm/vmalloc.c	2004-11-27 16:14:04.875699808 +0200
@@ -389,7 +389,8 @@
  *	@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.
  */



^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2004-12-06  8:11 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-12-03 19:48 [PATCH] Document kfree and vfree NULL usage (resend) Pekka Enberg
2004-12-05 15:33 ` Manfred Spraul
2004-12-05 16:05   ` Kernel Stuff
2004-12-05 16:59     ` Manfred Spraul
2004-12-05 17:44       ` Kernel Stuff
2004-12-05 17:57         ` Manfred Spraul
2004-12-05 18:12           ` Parag Warudkar
2004-12-05 20:29             ` Pekka Enberg
     [not found]               ` <200412051648.08283.kernel-stuff@comcast.net>
2004-12-06  8:09                 ` Pekka Enberg
2004-12-05 20:21       ` Pekka Enberg
2004-12-05 20:38         ` Parag Warudkar

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox