diff --git a/mm/slab.c b/mm/slab.c index a041c5378dfa59895c411d07b88cf69153275a11..05a391059fe1d92b58a85fb5cb1e3039f6fa6468 100644 --- 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. */ diff --git a/mm/vmalloc.c b/mm/vmalloc.c index 67b358e57ef67af05279196408c6c0bc430180c3..13c3d82968ae2a1e363dcc16e47474a716c5952d 100644 --- a/mm/vmalloc.c +++ b/mm/vmalloc.c @@ -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) {