forked from ~ljy/RK356X_SDK_RELEASE

hc
2023-12-08 01573e231f18eb2d99162747186f59511f56b64d
kernel/net/netlabel/netlabel_domainhash.c
....@@ -1,3 +1,4 @@
1
+// SPDX-License-Identifier: GPL-2.0-or-later
12 /*
23 * NetLabel Domain Hash Table
34 *
....@@ -7,25 +8,10 @@
78 * as CIPSO and RIPSO.
89 *
910 * Author: Paul Moore <paul@paul-moore.com>
10
- *
1111 */
1212
1313 /*
1414 * (c) Copyright Hewlett-Packard Development Company, L.P., 2006, 2008
15
- *
16
- * This program is free software; you can redistribute it and/or modify
17
- * it under the terms of the GNU General Public License as published by
18
- * the Free Software Foundation; either version 2 of the License, or
19
- * (at your option) any later version.
20
- *
21
- * This program is distributed in the hope that it will be useful,
22
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
23
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See
24
- * the GNU General Public License for more details.
25
- *
26
- * You should have received a copy of the GNU General Public License
27
- * along with this program; if not, see <http://www.gnu.org/licenses/>.
28
- *
2915 */
3016
3117 #include <linux/types.h>
....@@ -107,7 +93,7 @@
10793
10894 /**
10995 * netlbl_domhsh_hash - Hashing function for the domain hash table
110
- * @domain: the domain name to hash
96
+ * @key: the domain name to hash
11197 *
11298 * Description:
11399 * This is the hashing function for the domain hash table, it returns the
....@@ -158,7 +144,8 @@
158144 if (domain != NULL) {
159145 bkt = netlbl_domhsh_hash(domain);
160146 bkt_list = &netlbl_domhsh_rcu_deref(netlbl_domhsh)->tbl[bkt];
161
- list_for_each_entry_rcu(iter, bkt_list, list)
147
+ list_for_each_entry_rcu(iter, bkt_list, list,
148
+ lockdep_is_held(&netlbl_domhsh_lock))
162149 if (iter->valid &&
163150 netlbl_family_match(iter->family, family) &&
164151 strcmp(iter->domain, domain) == 0)
....@@ -625,9 +612,8 @@
625612 audit_buf = netlbl_audit_start_common(AUDIT_MAC_MAP_DEL, audit_info);
626613 if (audit_buf != NULL) {
627614 audit_log_format(audit_buf,
628
- " nlbl_domain=%s res=%u",
629
- entry->domain ? entry->domain : "(default)",
630
- ret_val == 0 ? 1 : 0);
615
+ " nlbl_domain=%s res=1",
616
+ entry->domain ? entry->domain : "(default)");
631617 audit_log_end(audit_buf);
632618 }
633619