提交 e4772668 编写于 作者: W wangweidong 提交者: David S. Miller

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: NWang Weidong <wangweidong1@huawei.com>
Acked-by: NNeil Horman <nhorman@tuxdriver.com>
Acked-by: NVlad Yasevich <vyasevich@gmail.com>
Signed-off-by: NDavid S. Miller <davem@davemloft.net>
上级 6b1dd856
......@@ -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);
}
/*
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册