* [PATCH 1/2] X25: Fix x25_create errors for bad protocol and ENOBUFS
@ 2010-02-06 23:16 andrew hendry
2010-02-11 1:54 ` David Miller
0 siblings, 1 reply; 4+ messages in thread
From: andrew hendry @ 2010-02-06 23:16 UTC (permalink / raw)
To: netdev, linux-kernel
alloc_socket failures should return -ENOBUFS
a bad protocol should return -EINVAL
Signed-off-by: Andrew Hendry <andrew.hendry@gmail.com>
---
diff --git a/net/x25/af_x25.c b/net/x25/af_x25.c
index e3219e4..6c7104e 100644
--- a/net/x25/af_x25.c
+++ b/net/x25/af_x25.c
@@ -512,15 +512,20 @@ static int x25_create(struct net *net, struct
socket *sock, int protocol,
{
struct sock *sk;
struct x25_sock *x25;
- int rc = -ESOCKTNOSUPPORT;
+ int rc = -EAFNOSUPPORT;
if (!net_eq(net, &init_net))
- return -EAFNOSUPPORT;
+ goto out;
+
+ rc = -ESOCKTNOSUPPORT;
+ if (sock->type != SOCK_SEQPACKET)
+ goto out;
- if (sock->type != SOCK_SEQPACKET || protocol)
+ rc = -EINVAL;
+ if (protocol)
goto out;
- rc = -ENOMEM;
+ rc = -ENOBUFS;
if ((sk = x25_alloc_socket(net)) == NULL)
goto out;
--
1.6.3.3
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH 1/2] X25: Fix x25_create errors for bad protocol and ENOBUFS
2010-02-06 23:16 andrew hendry
@ 2010-02-11 1:54 ` David Miller
0 siblings, 0 replies; 4+ messages in thread
From: David Miller @ 2010-02-11 1:54 UTC (permalink / raw)
To: andrew.hendry; +Cc: netdev, linux-kernel
From: andrew hendry <andrew.hendry@gmail.com>
Date: Sun, 7 Feb 2010 10:16:59 +1100
> alloc_socket failures should return -ENOBUFS
> a bad protocol should return -EINVAL
>
> Signed-off-by: Andrew Hendry <andrew.hendry@gmail.com>
Both of your patches were corrupted by your email client, so they
will not apply properly.
For example, long lines were chopped up into multiple lines.
See linux/Documentation/email-clients.txt for tips.
Please fix this up and resubmit your patches.
^ permalink raw reply [flat|nested] 4+ messages in thread
* [PATCH 1/2] X25: Fix x25_create errors for bad protocol and ENOBUFS
@ 2010-02-14 12:00 Andrew Hendry
2010-02-16 5:55 ` David Miller
0 siblings, 1 reply; 4+ messages in thread
From: Andrew Hendry @ 2010-02-14 12:00 UTC (permalink / raw)
To: netdev, linux-kernel
alloc_socket failures should return -ENOBUFS
a bad protocol should return -EINVAL
Signed-off-by: Andrew Hendry <andrew.hendry@gmail.com>
---
diff --git a/net/x25/af_x25.c b/net/x25/af_x25.c
index e3219e4..6c7104e 100644
--- a/net/x25/af_x25.c
+++ b/net/x25/af_x25.c
@@ -512,15 +512,20 @@ static int x25_create(struct net *net, struct socket *sock, int protocol,
{
struct sock *sk;
struct x25_sock *x25;
- int rc = -ESOCKTNOSUPPORT;
+ int rc = -EAFNOSUPPORT;
if (!net_eq(net, &init_net))
- return -EAFNOSUPPORT;
+ goto out;
+
+ rc = -ESOCKTNOSUPPORT;
+ if (sock->type != SOCK_SEQPACKET)
+ goto out;
- if (sock->type != SOCK_SEQPACKET || protocol)
+ rc = -EINVAL;
+ if (protocol)
goto out;
- rc = -ENOMEM;
+ rc = -ENOBUFS;
if ((sk = x25_alloc_socket(net)) == NULL)
goto out;
--
1.6.3.3
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH 1/2] X25: Fix x25_create errors for bad protocol and ENOBUFS
2010-02-14 12:00 [PATCH 1/2] X25: Fix x25_create errors for bad protocol and ENOBUFS Andrew Hendry
@ 2010-02-16 5:55 ` David Miller
0 siblings, 0 replies; 4+ messages in thread
From: David Miller @ 2010-02-16 5:55 UTC (permalink / raw)
To: andrew.hendry; +Cc: netdev, linux-kernel
From: Andrew Hendry <andrew.hendry@gmail.com>
Date: Sun, 14 Feb 2010 23:00:11 +1100
> alloc_socket failures should return -ENOBUFS
> a bad protocol should return -EINVAL
>
> Signed-off-by: Andrew Hendry <andrew.hendry@gmail.com>
Applied.
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2010-02-16 5:55 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-02-14 12:00 [PATCH 1/2] X25: Fix x25_create errors for bad protocol and ENOBUFS Andrew Hendry
2010-02-16 5:55 ` David Miller
-- strict thread matches above, loose matches on Subject: below --
2010-02-06 23:16 andrew hendry
2010-02-11 1:54 ` David Miller
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).