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>
This commit is contained in:
committed by
David S. Miller
parent
6b1dd85601
commit
e477266838
@@ -536,7 +536,6 @@ struct sock *sctp_err_lookup(struct net *net, int family, struct sk_buff *skb,
|
|||||||
return sk;
|
return sk;
|
||||||
|
|
||||||
out:
|
out:
|
||||||
if (asoc)
|
|
||||||
sctp_association_put(asoc);
|
sctp_association_put(asoc);
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
@@ -545,7 +544,6 @@ out:
|
|||||||
void sctp_err_finish(struct sock *sk, struct sctp_association *asoc)
|
void sctp_err_finish(struct sock *sk, struct sctp_association *asoc)
|
||||||
{
|
{
|
||||||
sctp_bh_unlock_sock(sk);
|
sctp_bh_unlock_sock(sk);
|
||||||
if (asoc)
|
|
||||||
sctp_association_put(asoc);
|
sctp_association_put(asoc);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user