bug-hurd
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH 2/4] kern: make kmem_error panic


From: Samuel Thibault
Subject: Re: [PATCH 2/4] kern: make kmem_error panic
Date: Tue, 4 Feb 2014 13:45:48 +0100
User-agent: Mutt/1.5.21+34 (58baf7c9f32f) (2010-12-30)

Justus Winter, le Tue 04 Feb 2014 11:50:02 +0100, a écrit :
> The slab allocator relies on the fact that kmem_cache_error does not
> return.  Previously, kmem_error was using printf.  Use panic instead.
> 
> Found using the Clang Static Analyzer.
> 
> * kern/slab.c (kmem_error): Use panic instead of printf.

Ack

> ---
>  kern/slab.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/kern/slab.c b/kern/slab.c
> index adf07e7..f40afa1 100644
> --- a/kern/slab.c
> +++ b/kern/slab.c
> @@ -289,8 +289,8 @@ vm_map_t kmem_map = &kmem_map_store;
>  static unsigned long kmem_gc_last_tick;
>  
>  #define kmem_error(format, ...)                         \
> -    printf("mem: error: %s(): " format "\n", __func__,  \
> -           ## __VA_ARGS__)
> +    panic("mem: error: %s(): " format "\n", __func__,   \
> +          ## __VA_ARGS__)
>  
>  #define kmem_warn(format, ...)                              \
>      printf("mem: warning: %s(): " format "\n", __func__,    \
> -- 
> 1.8.5.2
> 

-- 
Samuel
Anyone who thinks UNIX is intuitive should be forced to write 5000 lines of 
code using nothing but vi or emacs. AAAAACK!
(Discussion in comp.os.linux.misc on the intuitiveness of commands, especially
Emacs.)



reply via email to

[Prev in Thread] Current Thread [Next in Thread]