Skip to content

Commit

Permalink
tcp_memcontrol: fix reversed if condition
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Dan Carpenter authored and David S. Miller committed Dec 15, 2011
1 parent 888bdaa commit c48e074
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion net/ipv4/tcp_memcontrol.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit c48e074

Please sign in to comment.