浏览代码

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>
Dan Carpenter 13 年之前
父节点
当前提交
c48e074c7c
共有 1 个文件被更改,包括 1 次插入1 次删除
  1. 1 1
      net/ipv4/tcp_memcontrol.c

+ 1 - 1
net/ipv4/tcp_memcontrol.c

@@ -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);