提交 7f304b9e 编写于 作者: X Xin Long 提交者: David S. Miller

sctp: remove an unnecessary check from sctp_endpoint_destroy

ep->base.sk gets it's value since sctp_endpoint_new, nowhere
will change it. So there's no need to check if it's null, as
it can never be null.
Signed-off-by: NXin Long <lucien.xin@gmail.com>
Acked-by: NMarcelo Ricardo Leitner <marcelo.leitner@gmail.com>
Signed-off-by: NDavid S. Miller <davem@davemloft.net>
上级 0b58e6db
...@@ -268,16 +268,14 @@ static void sctp_endpoint_destroy(struct sctp_endpoint *ep) ...@@ -268,16 +268,14 @@ static void sctp_endpoint_destroy(struct sctp_endpoint *ep)
memset(ep->secret_key, 0, sizeof(ep->secret_key)); memset(ep->secret_key, 0, sizeof(ep->secret_key));
/* Give up our hold on the sock. */
sk = ep->base.sk; sk = ep->base.sk;
if (sk != NULL) { /* Remove and free the port */
/* Remove and free the port */ if (sctp_sk(sk)->bind_hash)
if (sctp_sk(sk)->bind_hash) sctp_put_port(sk);
sctp_put_port(sk);
sctp_sk(sk)->ep = NULL; sctp_sk(sk)->ep = NULL;
sock_put(sk); /* Give up our hold on the sock */
} sock_put(sk);
kfree(ep); kfree(ep);
SCTP_DBG_OBJCNT_DEC(ep); SCTP_DBG_OBJCNT_DEC(ep);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册