| .. | .. |
|---|
| 1 | 1 | // 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: |
|---|
| 3 | 3 | * |
|---|
| 4 | 4 | * 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/>. |
|---|
| 17 | 5 | */ |
|---|
| 18 | 6 | |
|---|
| 19 | 7 | #include "main.h" |
|---|
| .. | .. |
|---|
| 62 | 50 | */ |
|---|
| 63 | 51 | static void batadv_tvlv_handler_put(struct batadv_tvlv_handler *tvlv_handler) |
|---|
| 64 | 52 | { |
|---|
| 53 | + if (!tvlv_handler) |
|---|
| 54 | + return; |
|---|
| 55 | + |
|---|
| 65 | 56 | kref_put(&tvlv_handler->refcount, batadv_tvlv_handler_release); |
|---|
| 66 | 57 | } |
|---|
| 67 | 58 | |
|---|
| .. | .. |
|---|
| 118 | 109 | */ |
|---|
| 119 | 110 | static void batadv_tvlv_container_put(struct batadv_tvlv_container *tvlv) |
|---|
| 120 | 111 | { |
|---|
| 112 | + if (!tvlv) |
|---|
| 113 | + return; |
|---|
| 114 | + |
|---|
| 121 | 115 | kref_put(&tvlv->refcount, batadv_tvlv_container_release); |
|---|
| 122 | 116 | } |
|---|
| 123 | 117 | |
|---|
| .. | .. |
|---|
| 365 | 359 | * @tvlv_value: tvlv content |
|---|
| 366 | 360 | * @tvlv_value_len: tvlv content length |
|---|
| 367 | 361 | * |
|---|
| 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. |
|---|
| 370 | 364 | */ |
|---|
| 371 | 365 | static int batadv_tvlv_call_handler(struct batadv_priv *bat_priv, |
|---|
| 372 | 366 | struct batadv_tvlv_handler *tvlv_handler, |
|---|