Showing error 1092

User: Jiri Slaby
Error type: Leaving function in locked state
Error type description: Some lock is not unlocked on all paths of a function, so it is leaked
File location: ipc/shm.c
Line in file: 414
Project: Linux Kernel
Project version: 2.6.28
Tools: Undetermined 1
Entered: 2012-03-04 17:07:06 UTC


Source:

 384
 385        id = ipc_addid(&shm_ids(ns), &shp->shm_perm, ns->shm_ctlmni);
 386        if (id < 0) {
 387                error = id;
 388                goto no_id;
 389        }
 390
 391        shp->shm_cprid = task_tgid_vnr(current);
 392        shp->shm_lprid = 0;
 393        shp->shm_atim = shp->shm_dtim = 0;
 394        shp->shm_ctim = get_seconds();
 395        shp->shm_segsz = size;
 396        shp->shm_nattch = 0;
 397        shp->shm_file = file;
 398        /*
 399         * shmid gets reported as "inode#" in /proc/pid/maps.
 400         * proc-ps tools use this. Changing this will break them.
 401         */
 402        file->f_dentry->d_inode->i_ino = shp->shm_perm.id;
 403
 404        ns->shm_tot += numpages;
 405        error = shp->shm_perm.id;
 406        shm_unlock(shp);
 407        return error;
 408
 409no_id:
 410        fput(file);
 411no_file:
 412        security_shm_free(shp);
 413        ipc_rcu_putref(shp);
 414        return error;
 415}
 416
 417/*
 418 * Called with shm_ids.rw_mutex and ipcp locked.
 419 */
 420static inline int shm_security(struct kern_ipc_perm *ipcp, int shmflg)
 421{
 422        struct shmid_kernel *shp;
 423
 424        shp = container_of(ipcp, struct shmid_kernel, shm_perm);
Show full sources