intel/numatop

proc_obsolete potentially performs a lock operation on an uninitialized mutex

Closed this issue · 1 comments

Static analysis by CoverityScan detected a potential incorrect lock operation on a mutex:

654 static void
655 proc_obsolete(pid_t pid)
656 {
657        track_proc_t *proc;
658
   1. Condition (proc = proc_find(pid)) != NULL, taking true branch.
659        if ((proc = proc_find(pid)) != NULL) {
   2. destroy: proc_refcount_dec destroys proc->mutex. [show details]
660                proc_refcount_dec(proc);
661                (void) pthread_mutex_lock(&s_proc_group.mutex);
662                proc_group_remove(proc);
   CID 175280: Uninitialized lock use (LOCK)3. uninitialized_use: proc_free uses proc->mutex in an uninitialized state.
663                proc_free(proc);
664                (void) pthread_mutex_unlock(&s_proc_group.mutex);
665        }
666 }

I've re-analysed this and I believe this is a false positive. Marking it closed.