From: Dan Carpenter Date: Thu, 2 Oct 2008 21:50:14 +0000 (-0700) Subject: fix error-path NULL deref in alloc_posix_timer() X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=aa94fbd5ccd840c8ab26d02439ec799b03a72547;p=GitHub%2FLineageOS%2Fandroid_kernel_motorola_exynos9610.git fix error-path NULL deref in alloc_posix_timer() Found by static checker (http://repo.or.cz/w/smatch.git). Signed-off-by: Dan Carpenter Acked-by: Thomas Gleixner Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- diff --git a/kernel/posix-timers.c b/kernel/posix-timers.c index e36d5798cbff..5131e5471169 100644 --- a/kernel/posix-timers.c +++ b/kernel/posix-timers.c @@ -441,7 +441,7 @@ static struct k_itimer * alloc_posix_timer(void) return tmr; if (unlikely(!(tmr->sigq = sigqueue_alloc()))) { kmem_cache_free(posix_timers_cache, tmr); - tmr = NULL; + return NULL; } memset(&tmr->sigq->info, 0, sizeof(siginfo_t)); return tmr;