From: David Miller <davem@davemloft.net>
To: dan.carpenter@oracle.com
Cc: glommer@parallels.com, kuznet@ms2.inr.ac.ru, jmorris@namei.org,
yoshfuji@linux-ipv6.org, kaber@trash.net, netdev@vger.kernel.org,
kernel-janitors@vger.kernel.org
Subject: Re: [patch -next] tcp_memcontrol: fix reversed if condition
Date: Thu, 15 Dec 2011 12:01:08 -0500 (EST) [thread overview]
Message-ID: <20111215.120108.663752764643957547.davem@davemloft.net> (raw)
In-Reply-To: <20111215110510.GA2674@elgon.mountain>
From: Dan Carpenter <dan.carpenter@oracle.com>
Date: Thu, 15 Dec 2011 14:05:10 +0300
> We should only dereference the pointer if it's valid, not the other way
> round.
>
> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
It's nice to see how thoroughly this code has been tested, sigh...
Applied, thanks a lot Dan.
> diff --git a/net/ipv4/tcp_memcontrol.c b/net/ipv4/tcp_memcontrol.c
> index 171d7b6..7fed04f 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);
prev parent reply other threads:[~2011-12-15 17:04 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-12-15 11:05 [patch -next] tcp_memcontrol: fix reversed if condition Dan Carpenter
2011-12-15 17:01 ` David Miller [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20111215.120108.663752764643957547.davem@davemloft.net \
--to=davem@davemloft.net \
--cc=dan.carpenter@oracle.com \
--cc=glommer@parallels.com \
--cc=jmorris@namei.org \
--cc=kaber@trash.net \
--cc=kernel-janitors@vger.kernel.org \
--cc=kuznet@ms2.inr.ac.ru \
--cc=netdev@vger.kernel.org \
--cc=yoshfuji@linux-ipv6.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).