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
<[EMAIL PROTECTED]>
-
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to