| 1106 | } |
| 1107 | |
| 1108 | static void |
| 1109 | tty_dealloc(void *arg) |
| 1110 | { |
| 1111 | struct tty *tp = arg; |
| 1112 | |
| 1113 | /* |
| 1114 | * ttyydev_leave() usually frees the i/o queues earlier, but it is |
| 1115 | * not always called between queue allocation and here. The queues |
| 1116 | * may be allocated by ioctls on a pty control device without the |
| 1117 | * corresponding pty slave device ever being open, or after it is |
| 1118 | * closed. |
| 1119 | */ |
| 1120 | ttyinq_free(&tp->t_inq); |
| 1121 | ttyoutq_free(&tp->t_outq); |
| 1122 | seldrain(&tp->t_inpoll); |
| 1123 | seldrain(&tp->t_outpoll); |
| 1124 | knlist_destroy(&tp->t_inpoll.si_note); |
| 1125 | knlist_destroy(&tp->t_outpoll.si_note); |
| 1126 | |
| 1127 | cv_destroy(&tp->t_inwait); |
| 1128 | cv_destroy(&tp->t_outwait); |
| 1129 | cv_destroy(&tp->t_bgwait); |
| 1130 | cv_destroy(&tp->t_dcdwait); |
| 1131 | cv_destroy(&tp->t_outserwait); |
| 1132 | |
| 1133 | if (tp->t_mtx == &tp->t_mtxobj) |
| 1134 | mtx_destroy(&tp->t_mtxobj); |
| 1135 | ttydevsw_free(tp); |
| 1136 | free(tp, M_TTY); |
| 1137 | } |
| 1138 | |
| 1139 | static void |
| 1140 | tty_rel_free(struct tty *tp) |
nothing calls this directly
no test coverage detected