From f1e078bd840ffbe45cb827513ca452157e4b7b24 Mon Sep 17 00:00:00 2001 From: Garrett D'Amore Date: Thu, 28 Nov 2024 21:00:20 -0500 Subject: [PATCH] Pipe protocol data is never null. --- src/core/pipe.c | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/src/core/pipe.c b/src/core/pipe.c index c54cdfe0a..05089feec 100644 --- a/src/core/pipe.c +++ b/src/core/pipe.c @@ -37,9 +37,7 @@ pipe_destroy(void *arg) { nni_pipe *p = arg; - if (p->p_proto_data != NULL) { - p->p_proto_ops.pipe_fini(p->p_proto_data); - } + p->p_proto_ops.pipe_fini(p->p_proto_data); if (p->p_tran_data != NULL) { p->p_tran_ops.p_fini(p->p_tran_data); } @@ -66,9 +64,7 @@ pipe_reap(void *arg) #endif nni_pipe_remove(p); - if (p->p_proto_data != NULL) { - p->p_proto_ops.pipe_stop(p->p_proto_data); - } + p->p_proto_ops.pipe_stop(p->p_proto_data); if ((p->p_tran_data != NULL) && (p->p_tran_ops.p_stop != NULL)) { p->p_tran_ops.p_stop(p->p_tran_data); } @@ -129,9 +125,7 @@ nni_pipe_close(nni_pipe *p) return; // We already did a close. } - if (p->p_proto_data != NULL) { - p->p_proto_ops.pipe_close(p->p_proto_data); - } + p->p_proto_ops.pipe_close(p->p_proto_data); // Close the underlying transport. if (p->p_tran_data != NULL) {