Showing error 961

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/util.c
Line in file: 291
Project: Linux Kernel
Project version: 2.6.28
Tools: Stanse (1.2)
Entered: 2012-03-02 21:35:17 UTC


Source:

 261        int id, err;
 262
 263        if (size > IPCMNI)
 264                size = IPCMNI;
 265
 266        if (ids->in_use >= size)
 267                return -ENOSPC;
 268
 269        spin_lock_init(&new->lock);
 270        new->deleted = 0;
 271        rcu_read_lock();
 272        spin_lock(&new->lock);
 273
 274        err = idr_get_new(&ids->ipcs_idr, new, &id);
 275        if (err) {
 276                spin_unlock(&new->lock);
 277                rcu_read_unlock();
 278                return err;
 279        }
 280
 281        ids->in_use++;
 282
 283        new->cuid = new->uid = current->euid;
 284        new->gid = new->cgid = current->egid;
 285
 286        new->seq = ids->seq++;
 287        if(ids->seq > ids->seq_max)
 288                ids->seq = 0;
 289
 290        new->id = ipc_buildid(id, new->seq);
 291        return id;
 292}
 293
 294/**
 295 *        ipcget_new        -        create a new ipc object
 296 *        @ns: namespace
 297 *        @ids: IPC identifer set
 298 *        @ops: the actual creation routine to call
 299 *        @params: its parameters
 300 *
 301 *        This routine is called by sys_msgget, sys_semget() and sys_shmget()
Show full sources