Skip to content

Commit

Permalink
Pipe protocol data is never null.
Browse files Browse the repository at this point in the history
  • Loading branch information
gdamore committed Dec 7, 2024
1 parent 2c98a72 commit f1e078b
Showing 1 changed file with 3 additions and 9 deletions.
12 changes: 3 additions & 9 deletions src/core/pipe.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand All @@ -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);
}
Expand Down Expand Up @@ -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) {
Expand Down

0 comments on commit f1e078b

Please sign in to comment.