diff options
Diffstat (limited to 'include')
-rw-r--r-- | include/net/lwtunnel.h | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/include/net/lwtunnel.h b/include/net/lwtunnel.h index 918e03c1dafa..b02039081b04 100644 --- a/include/net/lwtunnel.h +++ b/include/net/lwtunnel.h | |||
@@ -35,12 +35,16 @@ extern const struct lwtunnel_encap_ops __rcu * | |||
35 | lwtun_encaps[LWTUNNEL_ENCAP_MAX+1]; | 35 | lwtun_encaps[LWTUNNEL_ENCAP_MAX+1]; |
36 | 36 | ||
37 | #ifdef CONFIG_LWTUNNEL | 37 | #ifdef CONFIG_LWTUNNEL |
38 | static inline void lwtunnel_state_get(struct lwtunnel_state *lws) | 38 | static inline struct lwtunnel_state * |
39 | lwtstate_get(struct lwtunnel_state *lws) | ||
39 | { | 40 | { |
40 | atomic_inc(&lws->refcnt); | 41 | if (lws) |
42 | atomic_inc(&lws->refcnt); | ||
43 | |||
44 | return lws; | ||
41 | } | 45 | } |
42 | 46 | ||
43 | static inline void lwtunnel_state_put(struct lwtunnel_state *lws) | 47 | static inline void lwtstate_put(struct lwtunnel_state *lws) |
44 | { | 48 | { |
45 | if (!lws) | 49 | if (!lws) |
46 | return; | 50 | return; |
@@ -74,11 +78,13 @@ int lwtunnel_output6(struct sock *sk, struct sk_buff *skb); | |||
74 | 78 | ||
75 | #else | 79 | #else |
76 | 80 | ||
77 | static inline void lwtunnel_state_get(struct lwtunnel_state *lws) | 81 | static inline struct lwtunnel_state * |
82 | lwtstate_get(struct lwtunnel_state *lws) | ||
78 | { | 83 | { |
84 | return lws; | ||
79 | } | 85 | } |
80 | 86 | ||
81 | static inline void lwtunnel_state_put(struct lwtunnel_state *lws) | 87 | static inline void lwtstate_put(struct lwtunnel_state *lws) |
82 | { | 88 | { |
83 | } | 89 | } |
84 | 90 | ||