From c48e074c7c75c0de4652ea5f5bf4e74c8cf4e3dd Mon Sep 17 00:00:00 2001 From: Dan Carpenter Date: Thu, 15 Dec 2011 01:05:10 +0000 Subject: [PATCH] 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 Signed-off-by: David S. Miller --- net/ipv4/tcp_memcontrol.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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) 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); -- 2.39.5