diff options
author | wangweidong <wangweidong1@huawei.com> | 2013-12-11 03:42:14 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2013-12-11 15:39:34 -0500 |
commit | e47726683803616c773bc75c88cfb3eb54a8172b (patch) | |
tree | d0da5be3f278ed91223f6a7c4bfac30977fa686a /net/sctp | |
parent | 6b1dd8560179bd3328a3fb024ce1b63b772464fd (diff) |
sctp: remove redundant null check on asoc
In sctp_err_lookup, goto out while the asoc is not NULL, so remove the
check NULL. Also, in sctp_err_finish which called by sctp_v4_err and
sctp_v6_err, they pass asoc to sctp_err_finish while the asoc is not
NULL, so remove the check.
Signed-off-by: Wang Weidong <wangweidong1@huawei.com>
Acked-by: Neil Horman <nhorman@tuxdriver.com>
Acked-by: Vlad Yasevich <vyasevich@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/sctp')
-rw-r--r-- | net/sctp/input.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/net/sctp/input.c b/net/sctp/input.c index 66038533ca5c..2a192a7c5d81 100644 --- a/net/sctp/input.c +++ b/net/sctp/input.c | |||
@@ -536,8 +536,7 @@ struct sock *sctp_err_lookup(struct net *net, int family, struct sk_buff *skb, | |||
536 | return sk; | 536 | return sk; |
537 | 537 | ||
538 | out: | 538 | out: |
539 | if (asoc) | 539 | sctp_association_put(asoc); |
540 | sctp_association_put(asoc); | ||
541 | return NULL; | 540 | return NULL; |
542 | } | 541 | } |
543 | 542 | ||
@@ -545,8 +544,7 @@ out: | |||
545 | void sctp_err_finish(struct sock *sk, struct sctp_association *asoc) | 544 | void sctp_err_finish(struct sock *sk, struct sctp_association *asoc) |
546 | { | 545 | { |
547 | sctp_bh_unlock_sock(sk); | 546 | sctp_bh_unlock_sock(sk); |
548 | if (asoc) | 547 | sctp_association_put(asoc); |
549 | sctp_association_put(asoc); | ||
550 | } | 548 | } |
551 | 549 | ||
552 | /* | 550 | /* |