tcp_memcontrol: fix reversed if condition
authorDan Carpenter <dan.carpenter@oracle.com>
Thu, 15 Dec 2011 01:05:10 +0000 (01:05 +0000)
committerDavid S. Miller <davem@davemloft.net>
Thu, 15 Dec 2011 16:59:44 +0000 (11:59 -0500)
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>
net/ipv4/tcp_memcontrol.c

index 171d7b6..7fed04f 100644 (file)
@@ -44,7 +44,7 @@ static inline struct tcp_memcontrol *tcp_from_cgproto(struct cg_proto *cg_proto)
 
 static void memcg_tcp_enter_memory_pressure(struct sock *sk)
 {
-       if (!sk->sk_cgrp->memory_pressure)
+       if (sk->sk_cgrp->memory_pressure)
                *sk->sk_cgrp->memory_pressure = 1;
 }
 EXPORT_SYMBOL(memcg_tcp_enter_memory_pressure);