[openib-general] Re: [PATCH] IPOIB: initialization patch in ipoib

Michael S. Tsirkin mst at mellanox.co.il
Fri Feb 18 07:45:08 PST 2005


Quoting r. Shirley Ma <xma at us.ibm.com>:
> Subject: [PATCH] IPOIB: initialization patch in ipoib
> 
> 
> Here is the patch for :
> 
> 1. initialize path->ah = NULL
> 2. move neigh->neighbour->ops before kfree(neigh)
> 3. set neighbour->ops->destructor to NULL while kfree(neigh)
> 
> diff -urN infiniband/ulp/ipoib/ipoib_main.c infiniband-patch/ulp/ipoib/
> ipoib_main.c
> --- infiniband/ulp/ipoib/ipoib_main.c        2005-02-17 17:24:56.000000000
> +0000
> +++ infiniband-patch/ulp/ipoib/ipoib_main.c        2005-02-18
> @@ -450,8 +451,8 @@
> err:
>         *to_ipoib_neigh(skb->dst->neighbour) = NULL;
>         list_del(&neigh->list);
> -        kfree(neigh);
>         neigh->neighbour->ops->destructor = NULL;
> +        kfree(neigh);
> 
>         ++priv->stats.tx_dropped;
>         dev_kfree_skb_any(skb);

If the order of these operations really matters, wont you need
some kind of memory barrier in between?

-- 
MST - Michael S. Tsirkin



More information about the general mailing list