projects/linux·commit aa94fbd5

fix error-path NULL deref in alloc_posix_timer()

aa94fbd5 · Dan Carpenter <[email protected]> · 2008-10-02 14:50:14 -07:00

Found by static checker (http://repo.or.cz/w/smatch.git).

Signed-off-by: Dan Carpenter <[email protected]>
Acked-by: Thomas Gleixner <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
Commit
aa94fbd5ccd840c8ab26d02439ec799b03a72547
Parents
c0c9209d

Changes

1 files changed · +1 −1

FileStatusAddDelContent
kernel/posix-timers.cmodified+1−1View file

kernel/posix-timers.c

View file
diff --git a/kernel/posix-timers.c b/kernel/posix-timers.c
index e36d579..5131e54 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;