lkml.org 
[lkml]   [2011]   [May]   [9]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRe: [PATCH 8/8] proc: allocate storage for numa_maps statistics once
Date
>  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@jp.fujitsu.com>






\
 
 \ /
  Last update: 2011-05-09 10:27    [from the cache]
©2003-2011 Jasper Spaans