Commit aa94fbd5ccd840c8ab26d02439ec799b03a72547

Authored by Dan Carpenter
Committed by Linus Torvalds
1 parent c0c9209ddd

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 <error27@gmail.com>
Acked-by: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>

Showing 1 changed file with 1 additions and 1 deletions Side-by-side Diff

kernel/posix-timers.c
... ... @@ -441,7 +441,7 @@
441 441 return tmr;
442 442 if (unlikely(!(tmr->sigq = sigqueue_alloc()))) {
443 443 kmem_cache_free(posix_timers_cache, tmr);
444   - tmr = NULL;
  444 + return NULL;
445 445 }
446 446 memset(&tmr->sigq->info, 0, sizeof(siginfo_t));
447 447 return tmr;