Re: [PATCH 8/8] proc: allocate storage for numa_maps statistics once

From: KOSAKI Motohiro
Date: Mon May 09 2011 - 04:24:38 EST


> static int numa_maps_open(struct inode *inode, struct file *file)
> {
> - return do_maps_open(inode, file, &proc_pid_numa_maps_op);
> + struct numa_maps_private *priv;
> + int ret = -ENOMEM;
> + priv = kzalloc(sizeof(*priv), GFP_KERNEL);
> + if (priv) {
> + priv->proc_maps.pid = proc_pid(inode);
> + ret = seq_open(file, &proc_pid_numa_maps_op);
> + if (!ret) {
> + struct seq_file *m = file->private_data;
> + m->private = priv;
> + } else {
> + kfree(priv);
> + }
> + }
> + return ret;
> }

Looks good to me.
Reviewed-by: KOSAKI Motohiro <kosaki.motohiro@xxxxxxxxxxxxxx>




--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/