diff options
Diffstat (limited to 'include')
-rw-r--r-- | include/linux/list.h | 2 | ||||
-rw-r--r-- | include/net/inet_timewait_sock.h | 2 | ||||
-rw-r--r-- | include/net/sock.h | 2 |
3 files changed, 3 insertions, 3 deletions
diff --git a/include/linux/list.h b/include/linux/list.h index 67258b47e9ca..76f05718342c 100644 --- a/include/linux/list.h +++ b/include/linux/list.h | |||
@@ -619,7 +619,7 @@ static inline void hlist_del_rcu(struct hlist_node *n) | |||
619 | 619 | ||
620 | static inline void hlist_del_init(struct hlist_node *n) | 620 | static inline void hlist_del_init(struct hlist_node *n) |
621 | { | 621 | { |
622 | if (n->pprev) { | 622 | if (!hlist_unhashed(n)) { |
623 | __hlist_del(n); | 623 | __hlist_del(n); |
624 | INIT_HLIST_NODE(n); | 624 | INIT_HLIST_NODE(n); |
625 | } | 625 | } |
diff --git a/include/net/inet_timewait_sock.h b/include/net/inet_timewait_sock.h index 1da294c47522..e837f98fdb50 100644 --- a/include/net/inet_timewait_sock.h +++ b/include/net/inet_timewait_sock.h | |||
@@ -150,7 +150,7 @@ static inline void inet_twsk_add_bind_node(struct inet_timewait_sock *tw, | |||
150 | 150 | ||
151 | static inline int inet_twsk_dead_hashed(const struct inet_timewait_sock *tw) | 151 | static inline int inet_twsk_dead_hashed(const struct inet_timewait_sock *tw) |
152 | { | 152 | { |
153 | return tw->tw_death_node.pprev != NULL; | 153 | return !hlist_unhashed(&tw->tw_death_node); |
154 | } | 154 | } |
155 | 155 | ||
156 | static inline void inet_twsk_dead_node_init(struct inet_timewait_sock *tw) | 156 | static inline void inet_twsk_dead_node_init(struct inet_timewait_sock *tw) |
diff --git a/include/net/sock.h b/include/net/sock.h index ff8b0dad7b0f..c9fad6fb629b 100644 --- a/include/net/sock.h +++ b/include/net/sock.h | |||
@@ -279,7 +279,7 @@ static inline int sk_unhashed(const struct sock *sk) | |||
279 | 279 | ||
280 | static inline int sk_hashed(const struct sock *sk) | 280 | static inline int sk_hashed(const struct sock *sk) |
281 | { | 281 | { |
282 | return sk->sk_node.pprev != NULL; | 282 | return !sk_unhashed(sk); |
283 | } | 283 | } |
284 | 284 | ||
285 | static __inline__ void sk_node_init(struct hlist_node *node) | 285 | static __inline__ void sk_node_init(struct hlist_node *node) |