| 109 | } |
| 110 | |
| 111 | static struct label * |
| 112 | mac_ipq_label_alloc(int flag) |
| 113 | { |
| 114 | struct label *label; |
| 115 | int error; |
| 116 | |
| 117 | label = mac_labelzone_alloc(flag); |
| 118 | if (label == NULL) |
| 119 | return (NULL); |
| 120 | |
| 121 | if (flag & M_WAITOK) |
| 122 | MAC_POLICY_CHECK(ipq_init_label, label, flag); |
| 123 | else |
| 124 | MAC_POLICY_CHECK_NOSLEEP(ipq_init_label, label, flag); |
| 125 | if (error) { |
| 126 | MAC_POLICY_PERFORM_NOSLEEP(ipq_destroy_label, label); |
| 127 | mac_labelzone_free(label); |
| 128 | return (NULL); |
| 129 | } |
| 130 | return (label); |
| 131 | } |
| 132 | |
| 133 | int |
| 134 | mac_ipq_init(struct ipq *q, int flag) |
no test coverage detected