diff mbox

fix return values of l2tp_dfs_seq_open()

Message ID 20110605105403.GC11521@ZenIV.linux.org.uk
State Accepted, archived
Delegated to: David Miller
Headers show

Commit Message

Al Viro June 5, 2011, 10:54 a.m. UTC
More fallout from struct net lifetime rules review: PTR_ERR() is *already*
negative and failing ->open() should return negatives on failure.

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
---
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Comments

James Chapman June 5, 2011, 11:05 a.m. UTC | #1
On 05/06/2011 11:54, Al Viro wrote:
> More fallout from struct net lifetime rules review: PTR_ERR() is *already*
> negative and failing ->open() should return negatives on failure.
> 
> Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
> ---
> diff --git a/net/l2tp/l2tp_debugfs.c b/net/l2tp/l2tp_debugfs.c
> index b8dbae8..7613013 100644
> --- a/net/l2tp/l2tp_debugfs.c
> +++ b/net/l2tp/l2tp_debugfs.c
> @@ -258,7 +258,7 @@ static int l2tp_dfs_seq_open(struct inode *inode, struct file *file)
>  	 */
>  	pd->net = get_net_ns_by_pid(current->pid);
>  	if (IS_ERR(pd->net)) {
> -		rc = -PTR_ERR(pd->net);
> +		rc = PTR_ERR(pd->net);
>  		goto err_free_pd;
>  	}
>  

Whoops. Thanks Al.

Signed-off-by: James Chapman <jchapman@katalix.com>
David Miller June 5, 2011, 9:11 p.m. UTC | #2
From: Al Viro <viro@ZenIV.linux.org.uk>
Date: Sun, 5 Jun 2011 11:54:03 +0100

> More fallout from struct net lifetime rules review: PTR_ERR() is *already*
> negative and failing ->open() should return negatives on failure.
> 
> Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>

Al, I applied this and your get_net_ns_by_fd() fix to my net-2.6
tree.

Thanks!
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/net/l2tp/l2tp_debugfs.c b/net/l2tp/l2tp_debugfs.c
index b8dbae8..7613013 100644
--- a/net/l2tp/l2tp_debugfs.c
+++ b/net/l2tp/l2tp_debugfs.c
@@ -258,7 +258,7 @@  static int l2tp_dfs_seq_open(struct inode *inode, struct file *file)
 	 */
 	pd->net = get_net_ns_by_pid(current->pid);
 	if (IS_ERR(pd->net)) {
-		rc = -PTR_ERR(pd->net);
+		rc = PTR_ERR(pd->net);
 		goto err_free_pd;
 	}