diff mbox

IB/ipoib: Fix RCU annotations in ipoib_neigh_hash_init()

Message ID 55646F34.9010803@sandisk.com (mailing list archive)
State Accepted
Headers show

Commit Message

Bart Van Assche May 26, 2015, 1:03 p.m. UTC
Avoid that sparse complains about ipoib_neigh_hash_init(). This
patch does not change any functionality. See also patch "IPoIB:
Fix memory leak in the neigh table deletion flow" (commit ID
66172c09938b).

Signed-off-by: Bart Van Assche <bart.vanassche@sandisk.com>
Cc: Shlomo Pongratz <shlomop@mellanox.com>
---
 drivers/infiniband/ulp/ipoib/ipoib_main.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Comments

Doug Ledford May 26, 2015, 3:55 p.m. UTC | #1
On Tue, 2015-05-26 at 15:03 +0200, Bart Van Assche wrote:
> Avoid that sparse complains about ipoib_neigh_hash_init(). This
> patch does not change any functionality. See also patch "IPoIB:
> Fix memory leak in the neigh table deletion flow" (commit ID
> 66172c09938b).
> 
> Signed-off-by: Bart Van Assche <bart.vanassche@sandisk.com>
> Cc: Shlomo Pongratz <shlomop@mellanox.com>
> ---
>  drivers/infiniband/ulp/ipoib/ipoib_main.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/infiniband/ulp/ipoib/ipoib_main.c b/drivers/infiniband/ulp/ipoib/ipoib_main.c
> index 9e1b203..fec8207 100644
> --- a/drivers/infiniband/ulp/ipoib/ipoib_main.c
> +++ b/drivers/infiniband/ulp/ipoib/ipoib_main.c
> @@ -1128,7 +1128,7 @@ static int ipoib_neigh_hash_init(struct ipoib_dev_priv *priv)
>  {
>  	struct ipoib_neigh_table *ntbl = &priv->ntbl;
>  	struct ipoib_neigh_hash *htbl;
> -	struct ipoib_neigh **buckets;
> +	struct ipoib_neigh __rcu **buckets;
>  	u32 size;
>  
>  	clear_bit(IPOIB_NEIGH_TBL_FLUSH, &priv->flags);
> @@ -1146,7 +1146,7 @@ static int ipoib_neigh_hash_init(struct ipoib_dev_priv *priv)
>  	htbl->size = size;
>  	htbl->mask = (size - 1);
>  	htbl->buckets = buckets;
> -	ntbl->htbl = htbl;
> +	RCU_INIT_POINTER(ntbl->htbl, htbl);
>  	htbl->ntbl = ntbl;
>  	atomic_set(&ntbl->entries, 0);
>  

Thanks, applied.
diff mbox

Patch

diff --git a/drivers/infiniband/ulp/ipoib/ipoib_main.c b/drivers/infiniband/ulp/ipoib/ipoib_main.c
index 9e1b203..fec8207 100644
--- a/drivers/infiniband/ulp/ipoib/ipoib_main.c
+++ b/drivers/infiniband/ulp/ipoib/ipoib_main.c
@@ -1128,7 +1128,7 @@  static int ipoib_neigh_hash_init(struct ipoib_dev_priv *priv)
 {
 	struct ipoib_neigh_table *ntbl = &priv->ntbl;
 	struct ipoib_neigh_hash *htbl;
-	struct ipoib_neigh **buckets;
+	struct ipoib_neigh __rcu **buckets;
 	u32 size;
 
 	clear_bit(IPOIB_NEIGH_TBL_FLUSH, &priv->flags);
@@ -1146,7 +1146,7 @@  static int ipoib_neigh_hash_init(struct ipoib_dev_priv *priv)
 	htbl->size = size;
 	htbl->mask = (size - 1);
 	htbl->buckets = buckets;
-	ntbl->htbl = htbl;
+	RCU_INIT_POINTER(ntbl->htbl, htbl);
 	htbl->ntbl = ntbl;
 	atomic_set(&ntbl->entries, 0);