Date: Mon, 8 Jan 2018 15:54:30 +0000 (UTC) From: "Pedro F. Giffuni" <pfg@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r327699 - head/sys/sys Message-ID: <201801081554.w08FsUvX058393@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: pfg Date: Mon Jan 8 15:54:29 2018 New Revision: 327699 URL: https://svnweb.freebsd.org/changeset/base/327699 Log: Revert r327697: malloc(9): drop the __result_use_check attribute for the kernel allocator. My bad: __result_use_check just checks the for the general and we always want to make sure allocated memory is used, not only checked for nullness. Add it to reallocf since that was missing. Modified: head/sys/sys/malloc.h Modified: head/sys/sys/malloc.h ============================================================================== --- head/sys/sys/malloc.h Mon Jan 8 15:41:49 2018 (r327698) +++ head/sys/sys/malloc.h Mon Jan 8 15:54:29 2018 (r327699) @@ -176,7 +176,7 @@ void *contigmalloc(unsigned long size, struct malloc_t __alloc_size(1) __alloc_align(6); void free(void *addr, struct malloc_type *type); void *malloc(unsigned long size, struct malloc_type *type, int flags) - __malloc_like __alloc_size(1); + __malloc_like __result_use_check __alloc_size(1); void *mallocarray(size_t nmemb, size_t size, struct malloc_type *type, int flags) __malloc_like __result_use_check __alloc_size(1) __alloc_size(2); @@ -187,9 +187,9 @@ void malloc_type_freed(struct malloc_type *type, unsig void malloc_type_list(malloc_type_list_func_t *, void *); void malloc_uninit(void *); void *realloc(void *addr, unsigned long size, struct malloc_type *type, - int flags) __alloc_size(2); + int flags) __result_use_check __alloc_size(2); void *reallocf(void *addr, unsigned long size, struct malloc_type *type, - int flags) __alloc_size(2); + int flags) __result_use_check __alloc_size(2); struct malloc_type *malloc_desc2type(const char *desc); #endif /* _KERNEL */
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201801081554.w08FsUvX058393>