From: Herbert Xu <herbert@gondor.apana.org.au>
To: Nicholas Krause <xerofoify@gmail.com>
Cc: steffen.klassert@secunet.com, davem@davemloft.net,
kuznet@ms2.inr.ac.ru, jmorris@namei.org, yoshfuji@linux-ipv6.org,
kaber@trash.net, netdev@vger.kernel.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH] ipsec:Fix error handling in the function xfrm6_get_addr
Date: Fri, 31 Jul 2015 08:00:19 +0800 [thread overview]
Message-ID: <20150731000019.GA22464@gondor.apana.org.au> (raw)
In-Reply-To: <1438273240-15493-1-git-send-email-xerofoify@gmail.com>
On Thu, Jul 30, 2015 at 12:20:40PM -0400, Nicholas Krause wrote:
>
> diff --git a/net/ipv6/xfrm6_policy.c b/net/ipv6/xfrm6_policy.c
> index ed0583c..f60c670 100644
> --- a/net/ipv6/xfrm6_policy.c
> +++ b/net/ipv6/xfrm6_policy.c
> @@ -61,7 +61,9 @@ static int xfrm6_get_saddr(struct net *net,
> return -EHOSTUNREACH;
>
> dev = ip6_dst_idev(dst)->dev;
> - ipv6_dev_get_saddr(dev_net(dev), dev, &daddr->in6, 0, &saddr->in6);
> + if (ipv6_dev_get_saddr(dev_net(dev), dev, &daddr->in6, 0, &saddr->in6))
> + return -EADDRNOTAVAIL;
> +
> dst_release(dst);
You're leaking dst.
Cheers,
--
Email: Herbert Xu <herbert@gondor.apana.org.au>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt
next parent reply other threads:[~2015-07-31 0:00 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <1438273240-15493-1-git-send-email-xerofoify@gmail.com>
2015-07-31 0:00 ` Herbert Xu [this message]
2016-04-05 14:23 [PATCH] ipsec: Fix error handling in the function xfrm6_get_addr Bastien Philbert
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=20150731000019.GA22464@gondor.apana.org.au \
--to=herbert@gondor.apana.org.au \
--cc=davem@davemloft.net \
--cc=jmorris@namei.org \
--cc=kaber@trash.net \
--cc=kuznet@ms2.inr.ac.ru \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=steffen.klassert@secunet.com \
--cc=xerofoify@gmail.com \
--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