hc
2023-12-11 d2ccde1c8e90d38cee87a1b0309ad2827f3fd30d
kernel/net/batman-adv/tvlv.c
....@@ -1,19 +1,7 @@
11 // SPDX-License-Identifier: GPL-2.0
2
-/* Copyright (C) 2007-2018 B.A.T.M.A.N. contributors:
2
+/* Copyright (C) 2007-2020 B.A.T.M.A.N. contributors:
33 *
44 * Marek Lindner, Simon Wunderlich
5
- *
6
- * This program is free software; you can redistribute it and/or
7
- * modify it under the terms of version 2 of the GNU General Public
8
- * License as published by the Free Software Foundation.
9
- *
10
- * This program is distributed in the hope that it will be useful, but
11
- * WITHOUT ANY WARRANTY; without even the implied warranty of
12
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13
- * General Public License for more details.
14
- *
15
- * You should have received a copy of the GNU General Public License
16
- * along with this program; if not, see <http://www.gnu.org/licenses/>.
175 */
186
197 #include "main.h"
....@@ -62,6 +50,9 @@
6250 */
6351 static void batadv_tvlv_handler_put(struct batadv_tvlv_handler *tvlv_handler)
6452 {
53
+ if (!tvlv_handler)
54
+ return;
55
+
6556 kref_put(&tvlv_handler->refcount, batadv_tvlv_handler_release);
6657 }
6758
....@@ -118,6 +109,9 @@
118109 */
119110 static void batadv_tvlv_container_put(struct batadv_tvlv_container *tvlv)
120111 {
112
+ if (!tvlv)
113
+ return;
114
+
121115 kref_put(&tvlv->refcount, batadv_tvlv_container_release);
122116 }
123117
....@@ -365,8 +359,8 @@
365359 * @tvlv_value: tvlv content
366360 * @tvlv_value_len: tvlv content length
367361 *
368
- * Return: success if handler was not found or the return value of the handler
369
- * callback.
362
+ * Return: success if the handler was not found or the return value of the
363
+ * handler callback.
370364 */
371365 static int batadv_tvlv_call_handler(struct batadv_priv *bat_priv,
372366 struct batadv_tvlv_handler *tvlv_handler,