Commit aa94fbd5 authored by Dan Carpenter's avatar Dan Carpenter Committed by Linus Torvalds

fix error-path NULL deref in alloc_posix_timer()

Found by static checker (http://repo.or.cz/w/smatch.git).
Signed-off-by: default avatarDan Carpenter <error27@gmail.com>
Acked-by: default avatarThomas Gleixner <tglx@linutronix.de>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent c0c9209d
...@@ -441,7 +441,7 @@ static struct k_itimer * alloc_posix_timer(void) ...@@ -441,7 +441,7 @@ static struct k_itimer * alloc_posix_timer(void)
return tmr; return tmr;
if (unlikely(!(tmr->sigq = sigqueue_alloc()))) { if (unlikely(!(tmr->sigq = sigqueue_alloc()))) {
kmem_cache_free(posix_timers_cache, tmr); kmem_cache_free(posix_timers_cache, tmr);
tmr = NULL; return NULL;
} }
memset(&tmr->sigq->info, 0, sizeof(siginfo_t)); memset(&tmr->sigq->info, 0, sizeof(siginfo_t));
return tmr; return tmr;
......
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