aboutsummaryrefslogtreecommitdiffstats
path: root/net/ipv4/tcp_memcontrol.c
diff options
context:
space:
mode:
authorDan Carpenter <dan.carpenter@oracle.com>2011-12-14 20:05:10 -0500
committerDavid S. Miller <davem@davemloft.net>2011-12-15 11:59:44 -0500
commitc48e074c7c75c0de4652ea5f5bf4e74c8cf4e3dd (patch)
tree420f3e91fc506f841e1caacc436a1780f8a4d1a9 /net/ipv4/tcp_memcontrol.c
parent888bdaa9b2c426dcca214e6efd388080938082cb (diff)
tcp_memcontrol: fix reversed if condition
We should only dereference the pointer if it's valid, not the other way round. Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/ipv4/tcp_memcontrol.c')
-rw-r--r--net/ipv4/tcp_memcontrol.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/net/ipv4/tcp_memcontrol.c b/net/ipv4/tcp_memcontrol.c
index 171d7b64f803..7fed04f875c1 100644
--- a/net/ipv4/tcp_memcontrol.c
+++ b/net/ipv4/tcp_memcontrol.c
@@ -44,7 +44,7 @@ static inline struct tcp_memcontrol *tcp_from_cgproto(struct cg_proto *cg_proto)
44 44
45static void memcg_tcp_enter_memory_pressure(struct sock *sk) 45static void memcg_tcp_enter_memory_pressure(struct sock *sk)
46{ 46{
47 if (!sk->sk_cgrp->memory_pressure) 47 if (sk->sk_cgrp->memory_pressure)
48 *sk->sk_cgrp->memory_pressure = 1; 48 *sk->sk_cgrp->memory_pressure = 1;
49} 49}
50EXPORT_SYMBOL(memcg_tcp_enter_memory_pressure); 50EXPORT_SYMBOL(memcg_tcp_enter_memory_pressure);