lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Date:	Fri, 10 Dec 2010 19:17:41 +0900 (JST)
From:	KOSAKI Motohiro <kosaki.motohiro@...fujitsu.com>
To:	bookjovi@...il.com
Cc:	kosaki.motohiro@...fujitsu.com, akpm@...ux-foundation.org,
	viro@...iv.linux.org.uk, rientjes@...gle.com, hch@....de,
	linux-kernel@...r.kernel.org
Subject: Re: [PATCH] proc: fix single_open usage

> fix some single_open function usage, use private_data as parameter
> 
> Signed-off-by: Jovi Zhang <bookjovi@...il.com>
> 
>  fs/proc/base.c |   29 +++--------------------------
>  1 files changed, 3 insertions(+), 26 deletions(-)

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


> 
> diff --git a/fs/proc/base.c b/fs/proc/base.c
> index f3d02ca..74a7d92 100644
> --- a/fs/proc/base.c
> +++ b/fs/proc/base.c
> @@ -751,14 +751,7 @@ static int proc_single_show(struct seq_file *m, void *v)
>  
>  static int proc_single_open(struct inode *inode, struct file *filp)
>  {
> -	int ret;
> -	ret = single_open(filp, proc_single_show, NULL);
> -	if (!ret) {
> -		struct seq_file *m = filp->private_data;
> -
> -		m->private = inode;
> -	}
> -	return ret;
> +	return single_open(filp, proc_single_show, inode);
>  }
>  
>  static const struct file_operations proc_single_file_operations = {
> @@ -1386,15 +1379,7 @@ sched_write(struct file *file, const char __user *buf,
>  
>  static int sched_open(struct inode *inode, struct file *filp)
>  {
> -	int ret;
> -
> -	ret = single_open(filp, sched_show, NULL);
> -	if (!ret) {
> -		struct seq_file *m = filp->private_data;
> -
> -		m->private = inode;
> -	}
> -	return ret;
> +	return single_open(filp, sched_show, inode);
>  }
>  
>  static const struct file_operations proc_pid_sched_operations = {
> @@ -1454,15 +1439,7 @@ static int comm_show(struct seq_file *m, void *v)
>  
>  static int comm_open(struct inode *inode, struct file *filp)
>  {
> -	int ret;
> -
> -	ret = single_open(filp, comm_show, NULL);
> -	if (!ret) {
> -		struct seq_file *m = filp->private_data;
> -
> -		m->private = inode;
> -	}
> -	return ret;
> +	return single_open(filp, comm_show, inode);
>  }
>  
>  static const struct file_operations proc_pid_set_comm_operations = {



--
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

Powered by Openwall GNU/*/Linux Powered by OpenVZ