Showing error 1094

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/msg.c
Line in file: 208
Project: Linux Kernel
Project version: 2.6.28
Tools: Undetermined 1
Entered: 2012-03-04 17:07:06 UTC


Source:

178 * Called with msg_ids.rw_mutex held (writer)
179 */
180static int newque(struct ipc_namespace *ns, struct ipc_params *params)
181{
182        struct msg_queue *msq;
183        int id, retval;
184        key_t key = params->key;
185        int msgflg = params->flg;
186
187        msq = ipc_rcu_alloc(sizeof(*msq));
188        if (!msq)
189                return -ENOMEM;
190
191        msq->q_perm.mode = msgflg & S_IRWXUGO;
192        msq->q_perm.key = key;
193
194        msq->q_perm.security = NULL;
195        retval = security_msg_queue_alloc(msq);
196        if (retval) {
197                ipc_rcu_putref(msq);
198                return retval;
199        }
200
201        /*
202         * ipc_addid() locks msq
203         */
204        id = ipc_addid(&msg_ids(ns), &msq->q_perm, ns->msg_ctlmni);
205        if (id < 0) {
206                security_msg_queue_free(msq);
207                ipc_rcu_putref(msq);
208                return id;
209        }
210
211        msq->q_stime = msq->q_rtime = 0;
212        msq->q_ctime = get_seconds();
213        msq->q_cbytes = msq->q_qnum = 0;
214        msq->q_qbytes = ns->msg_ctlmnb;
215        msq->q_lspid = msq->q_lrpid = 0;
216        INIT_LIST_HEAD(&msq->q_messages);
217        INIT_LIST_HEAD(&msq->q_receivers);
218        INIT_LIST_HEAD(&msq->q_senders);
Show full sources