[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <454E5437.1020909@in.ibm.com>
Date: Mon, 06 Nov 2006 02:44:31 +0530
From: Balbir Singh <balbir@...ibm.com>
To: menage@...gle.com
CC: sekharan@...ibm.com, ckrm-tech@...ts.sourceforge.net, pj@....com,
akpm@...l.org, jlan@....com, mbligh@...gle.com,
rohitseth@...gle.com, winget@...gle.com, Simon.Derr@...l.net,
linux-kernel <linux-kernel@...r.kernel.org>
Subject: Re: [ckrm-tech] [PATCH 6/6] Resource Groups over generic containers
Hi, Paul,
I've just started playing with the new patchset and found a few issues.
menage@...gle.com wrote:
> +ssize_t res_group_file_write(struct container *cont,
> + struct cftype *cft,
> + struct file *file,
> + const char __user *userbuf,
> + size_t nbytes, loff_t *ppos)
> +{
> + struct res_group_cft *rgcft = container_of(cft, struct res_group_cft, cft);
> + struct res_controller *ctlr = rgcft->ctlr;
> +
> + if (nbytes >= PAGE_SIZE)
> + return -E2BIG;
> +
> + char *buf;
> + ssize_t retval;
> + int filetype = cft->private;
> +
> + buf = kmalloc(nbytes + 1, GFP_USER);
This should be kmalloc(nbytes), an echo ".." has a "\n" associated
with it.
> + if (!buf) return -ENOMEM;
> + if (copy_from_user(buf, userbuf, nbytes)) {
> + retval = -EFAULT;
> + goto out1;
> + }
> + buf[nbytes] = 0; /* nul-terminate */
> +
this should be buf[nbytes - 1]
--
Balbir Singh,
Linux Technology Center,
IBM Software Labs
-
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