Skip to contentSkip to conversation

possible NULL deref in alloc_posix_timer()

PATCH New Dan Carpenter 1 participant 1 message Sep 22, 2008

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 possible NULL deref in alloc_posix_timer()

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

posix-timers.c 2008-09-20 21:54:19.000000000 +0300 renamed from posix-timers.c.orig 2008-08-29 01:52:02.000000000 +0300 +1 -1
@@ -441,7 +441,7 @@
                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;