diff options
| author | Daniel Borkmann <dborkman@redhat.com> | 2013-06-14 12:24:06 -0400 |
|---|---|---|
| committer | David S. Miller <davem@davemloft.net> | 2013-06-14 18:38:36 -0400 |
| commit | c164b8381496ca797c37671fe510a264412ccae5 (patch) | |
| tree | 9a1c94d0f34927c943f2246c61cded2eb2595bad | |
| parent | 405426f6ca8ac2d8d5b1f8eb9285452d44222781 (diff) | |
net: sctp: minor: remove variable in sctp_init_sock
It's only used at this one time, so we could remove it as well.
This is valid and also makes it more explicit/obvious that in case
of error the sp->ep is NULL here, i.e. for the sctp_destroy_sock()
check that was recently added.
Signed-off-by: Daniel Borkmann <dborkman@redhat.com>
Acked-by: Vlad Yasevich <vyasevich@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
| -rw-r--r-- | net/sctp/socket.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/net/sctp/socket.c b/net/sctp/socket.c index f631c5ff4dbf..510dc79a32a1 100644 --- a/net/sctp/socket.c +++ b/net/sctp/socket.c | |||
| @@ -3862,7 +3862,6 @@ out: | |||
| 3862 | SCTP_STATIC int sctp_init_sock(struct sock *sk) | 3862 | SCTP_STATIC int sctp_init_sock(struct sock *sk) |
| 3863 | { | 3863 | { |
| 3864 | struct net *net = sock_net(sk); | 3864 | struct net *net = sock_net(sk); |
| 3865 | struct sctp_endpoint *ep; | ||
| 3866 | struct sctp_sock *sp; | 3865 | struct sctp_sock *sp; |
| 3867 | 3866 | ||
| 3868 | SCTP_DEBUG_PRINTK("sctp_init_sock(sk: %p)\n", sk); | 3867 | SCTP_DEBUG_PRINTK("sctp_init_sock(sk: %p)\n", sk); |
| @@ -3971,11 +3970,10 @@ SCTP_STATIC int sctp_init_sock(struct sock *sk) | |||
| 3971 | * change the data structure relationships, this may still | 3970 | * change the data structure relationships, this may still |
| 3972 | * be useful for storing pre-connect address information. | 3971 | * be useful for storing pre-connect address information. |
| 3973 | */ | 3972 | */ |
| 3974 | ep = sctp_endpoint_new(sk, GFP_KERNEL); | 3973 | sp->ep = sctp_endpoint_new(sk, GFP_KERNEL); |
| 3975 | if (!ep) | 3974 | if (!sp->ep) |
| 3976 | return -ENOMEM; | 3975 | return -ENOMEM; |
| 3977 | 3976 | ||
| 3978 | sp->ep = ep; | ||
| 3979 | sp->hmac = NULL; | 3977 | sp->hmac = NULL; |
| 3980 | 3978 | ||
| 3981 | SCTP_DBG_OBJCNT_INC(sock); | 3979 | SCTP_DBG_OBJCNT_INC(sock); |
