Netdev List
 help / color / mirror / Atom feed
From: James Morris <jmorris@namei.org>
To: Shinta Sugimoto <shinta@sfc.wide.ad.jp>
Cc: netdev@vger.kernel.org,
	Francis Dupont <Francis.Dupont@point6.net>,
	Masahide Nakamura <nakam@linux-ipv6.org>,
	usagi-core@linux-ipv6.org
Subject: Re: [RFC][PATCH][XFRM][1/5] extension to XFRM for dynamic endpoint update (MIGRATE)
Date: Thu, 1 Feb 2007 09:45:18 -0500 (EST)	[thread overview]
Message-ID: <Pine.LNX.4.64.0702010937250.8524@d.namei> (raw)
In-Reply-To: <20070201113017.E2BA.SHINTA@sfc.wide.ad.jp>

On Thu, 1 Feb 2007, Shinta Sugimoto wrote:


> +int xfrm_migrate(struct xfrm_selector *sel, u8 dir, u8 type,
> +		 struct xfrm_migrate *m, int num_migrate)
> +{
> +	int i, err, nx_cur = 0, nx_new = 0;
> +	struct xfrm_policy *pol = NULL;

[...]

> +donothing:
> +	if (pol)
> +		xfrm_pol_put(pol);

If you reach 'donothing', pol must be NULL, so you don't need to check for 
it before xfrm_pol_put().


> +#ifdef CONFIG_XFRM_MIGRATE
> +static struct xfrm_algo *xfrm_algo_solidclone(struct xfrm_algo *orig)
> +{
> +	struct xfrm_algo *a;
> +	a = kmalloc(sizeof(*orig) + orig->alg_key_len, GFP_KERNEL);
> +	if (a)
> +		memcpy(a, orig, sizeof(*orig) + orig->alg_key_len);

Use kmemdup() ?


> +        if (orig->encap) {
> +		x->encap = kmalloc(sizeof(*x->encap), GFP_KERNEL);
> +		if (!x->encap)
> +			goto error;
> +		memcpy(x->encap, orig->encap, sizeof(*x->encap));
> +	}
> +
> +	if (orig->coaddr) {
> +		x->coaddr = kmalloc(sizeof(*x->coaddr), GFP_KERNEL);
> +		if (!x->coaddr)
> +			goto error;
> +		memcpy(x->coaddr, orig->coaddr, sizeof(*x->coaddr));
> +	}

Ditto.

> +EXPORT_SYMBOL(xfrm_state_clone);

Why not EXPORT_SYMBOL_GPL ?
(for all of your exports).




- James
-- 
James Morris
<jmorris@namei.org>

  reply	other threads:[~2007-02-01 14:45 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-02-01  4:10 [RFC][PATCH][XFRM][1/5] extension to XFRM for dynamic endpoint update (MIGRATE) Shinta Sugimoto
2007-02-01 14:45 ` James Morris [this message]
2007-02-02 11:47   ` Shinta Sugimoto
2007-02-02 12:51     ` James Morris

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=Pine.LNX.4.64.0702010937250.8524@d.namei \
    --to=jmorris@namei.org \
    --cc=Francis.Dupont@point6.net \
    --cc=nakam@linux-ipv6.org \
    --cc=netdev@vger.kernel.org \
    --cc=shinta@sfc.wide.ad.jp \
    --cc=usagi-core@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