Skip to content

Commit

Permalink
net: sctp: minor: remove variable in sctp_init_sock
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Daniel Borkmann authored and David S. Miller committed Jun 14, 2013
1 parent 405426f commit c164b83
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions net/sctp/socket.c
Original file line number Diff line number Diff line change
Expand Up @@ -3862,7 +3862,6 @@ SCTP_STATIC int sctp_ioctl(struct sock *sk, int cmd, unsigned long arg)
SCTP_STATIC int sctp_init_sock(struct sock *sk)
{
struct net *net = sock_net(sk);
struct sctp_endpoint *ep;
struct sctp_sock *sp;

SCTP_DEBUG_PRINTK("sctp_init_sock(sk: %p)\n", sk);
Expand Down Expand Up @@ -3971,11 +3970,10 @@ SCTP_STATIC int sctp_init_sock(struct sock *sk)
* change the data structure relationships, this may still
* be useful for storing pre-connect address information.
*/
ep = sctp_endpoint_new(sk, GFP_KERNEL);
if (!ep)
sp->ep = sctp_endpoint_new(sk, GFP_KERNEL);
if (!sp->ep)
return -ENOMEM;

sp->ep = ep;
sp->hmac = NULL;

SCTP_DBG_OBJCNT_INC(sock);
Expand Down

0 comments on commit c164b83

Please sign in to comment.