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-Tag: v2.6.27-rc9~38 X-Git-Url: http://pilppa.com/gitweb/?a=commitdiff_plain;h=aa94fbd5ccd840c8ab26d02439ec799b03a72547;p=linux-2.6-omap-h63xx.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 e36d5798cbf..5131e547116 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;