From: wangweidong Date: Wed, 11 Dec 2013 08:42:14 +0000 (+0800) Subject: sctp: remove redundant null check on asoc X-Git-Tag: v3.14-rc1~94^2~511 X-Git-Url: https://asedeno.scripts.mit.edu/gitweb/?a=commitdiff_plain;h=e47726683803616c773bc75c88cfb3eb54a8172b;p=linux.git 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 Acked-by: Neil Horman Acked-by: Vlad Yasevich Signed-off-by: David S. Miller --- 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, return sk; out: - if (asoc) - sctp_association_put(asoc); + sctp_association_put(asoc); return NULL; } @@ -545,8 +544,7 @@ struct sock *sctp_err_lookup(struct net *net, int family, struct sk_buff *skb, void sctp_err_finish(struct sock *sk, struct sctp_association *asoc) { sctp_bh_unlock_sock(sk); - if (asoc) - sctp_association_put(asoc); + sctp_association_put(asoc); } /*