[NEIGH]: Revert 'Fix race between neigh_parms_release and neightbl_fill_parms'
authorDavid S. Miller <davem@davemloft.net>
Mon, 21 Jan 2008 00:39:03 +0000 (16:39 -0800)
committerDavid S. Miller <davem@davemloft.net>
Mon, 21 Jan 2008 04:31:42 +0000 (20:31 -0800)
Commit 9cd40029423701c376391da59d2c6469672b4bed (Fix race between
neigh_parms_release and neightbl_fill_parms) introduced device
reference counting regressions for several people, see:

http://bugzilla.kernel.org/show_bug.cgi?id=9778

for example.

Signed-off-by: David S. Miller <davem@davemloft.net>
net/core/neighbour.c

index cc8a2f190acfa75dd9cd0fef1149e82689fcfccb..29b8ee4e35d6dc53f32064c1c067c7287ce80924 100644 (file)
@@ -1316,6 +1316,8 @@ void neigh_parms_release(struct neigh_table *tbl, struct neigh_parms *parms)
                        *p = parms->next;
                        parms->dead = 1;
                        write_unlock_bh(&tbl->lock);
+                       if (parms->dev)
+                               dev_put(parms->dev);
                        call_rcu(&parms->rcu_head, neigh_rcu_free_parms);
                        return;
                }
@@ -1326,8 +1328,6 @@ void neigh_parms_release(struct neigh_table *tbl, struct neigh_parms *parms)
 
 void neigh_parms_destroy(struct neigh_parms *parms)
 {
-       if (parms->dev)
-               dev_put(parms->dev);
        kfree(parms);
 }