[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20090722172502.GA15805@lenovo>
Date: Wed, 22 Jul 2009 21:25:02 +0400
From: Cyrill Gorcunov <gorcunov@...il.com>
To: Oren Laadan <orenl@...rato.com>
Cc: Andrew Morton <akpm@...ux-foundation.org>,
Linus Torvalds <torvalds@...l.org>,
containers@...ts.linux-foundation.org,
linux-kernel@...r.kernel.org, linux-mm@...ck.org,
linux-api@...r.kernel.org, Serge Hallyn <serue@...ibm.com>,
Dave Hansen <dave@...ux.vnet.ibm.com>,
Ingo Molnar <mingo@...e.hu>, "H. Peter Anvin" <hpa@...or.com>,
Alexander Viro <viro@...iv.linux.org.uk>,
Pavel Emelyanov <xemul@...nvz.org>,
Alexey Dobriyan <adobriyan@...il.com>,
Oren Laadan <orenl@...columbia.edu>
Subject: Re: [RFC v17][PATCH 52/60] c/r: support semaphore sysv-ipc
[Oren Laadan - Wed, Jul 22, 2009 at 06:00:14AM -0400]
...
| +static struct sem *restore_sem_array(struct ckpt_ctx *ctx, int nsems)
| +{
| + struct sem *sma;
| + int i, ret;
| +
| + sma = kmalloc(nsems * sizeof(*sma), GFP_KERNEL);
Forgot to
if (!sma)
return -ENOMEM;
right?
| + ret = _ckpt_read_buffer(ctx, sma, nsems * sizeof(*sma));
| + if (ret < 0)
| + goto out;
| +
| + /* validate sem array contents */
| + for (i = 0; i < nsems; i++) {
| + if (sma[i].semval < 0 || sma[i].sempid < 0) {
| + ret = -EINVAL;
| + break;
| + }
| + }
| + out:
| + if (ret < 0) {
| + kfree(sma);
| + sma = ERR_PTR(ret);
| + }
| + return sma;
| +}
...
-- Cyrill
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists