diff options
Diffstat (limited to 'net/netlabel/netlabel_unlabeled.c')
-rw-r--r-- | net/netlabel/netlabel_unlabeled.c | 42 |
1 files changed, 2 insertions, 40 deletions
diff --git a/net/netlabel/netlabel_unlabeled.c b/net/netlabel/netlabel_unlabeled.c index e2b0a680dd56..9c38658fba8b 100644 --- a/net/netlabel/netlabel_unlabeled.c +++ b/net/netlabel/netlabel_unlabeled.c | |||
@@ -154,44 +154,6 @@ static const struct nla_policy netlbl_unlabel_genl_policy[NLBL_UNLABEL_A_MAX + 1 | |||
154 | */ | 154 | */ |
155 | 155 | ||
156 | /** | 156 | /** |
157 | * netlbl_unlhsh_free_addr4 - Frees an IPv4 address entry from the hash table | ||
158 | * @entry: the entry's RCU field | ||
159 | * | ||
160 | * Description: | ||
161 | * This function is designed to be used as a callback to the call_rcu() | ||
162 | * function so that memory allocated to a hash table address entry can be | ||
163 | * released safely. | ||
164 | * | ||
165 | */ | ||
166 | static void netlbl_unlhsh_free_addr4(struct rcu_head *entry) | ||
167 | { | ||
168 | struct netlbl_unlhsh_addr4 *ptr; | ||
169 | |||
170 | ptr = container_of(entry, struct netlbl_unlhsh_addr4, rcu); | ||
171 | kfree(ptr); | ||
172 | } | ||
173 | |||
174 | #if defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE) | ||
175 | /** | ||
176 | * netlbl_unlhsh_free_addr6 - Frees an IPv6 address entry from the hash table | ||
177 | * @entry: the entry's RCU field | ||
178 | * | ||
179 | * Description: | ||
180 | * This function is designed to be used as a callback to the call_rcu() | ||
181 | * function so that memory allocated to a hash table address entry can be | ||
182 | * released safely. | ||
183 | * | ||
184 | */ | ||
185 | static void netlbl_unlhsh_free_addr6(struct rcu_head *entry) | ||
186 | { | ||
187 | struct netlbl_unlhsh_addr6 *ptr; | ||
188 | |||
189 | ptr = container_of(entry, struct netlbl_unlhsh_addr6, rcu); | ||
190 | kfree(ptr); | ||
191 | } | ||
192 | #endif /* IPv6 */ | ||
193 | |||
194 | /** | ||
195 | * netlbl_unlhsh_free_iface - Frees an interface entry from the hash table | 157 | * netlbl_unlhsh_free_iface - Frees an interface entry from the hash table |
196 | * @entry: the entry's RCU field | 158 | * @entry: the entry's RCU field |
197 | * | 159 | * |
@@ -568,7 +530,7 @@ static int netlbl_unlhsh_remove_addr4(struct net *net, | |||
568 | if (entry == NULL) | 530 | if (entry == NULL) |
569 | return -ENOENT; | 531 | return -ENOENT; |
570 | 532 | ||
571 | call_rcu(&entry->rcu, netlbl_unlhsh_free_addr4); | 533 | kfree_rcu(entry, rcu); |
572 | return 0; | 534 | return 0; |
573 | } | 535 | } |
574 | 536 | ||
@@ -629,7 +591,7 @@ static int netlbl_unlhsh_remove_addr6(struct net *net, | |||
629 | if (entry == NULL) | 591 | if (entry == NULL) |
630 | return -ENOENT; | 592 | return -ENOENT; |
631 | 593 | ||
632 | call_rcu(&entry->rcu, netlbl_unlhsh_free_addr6); | 594 | kfree_rcu(entry, rcu); |
633 | return 0; | 595 | return 0; |
634 | } | 596 | } |
635 | #endif /* IPv6 */ | 597 | #endif /* IPv6 */ |