File tree 1 file changed +7
-9
lines changed
drivers/net/ethernet/chelsio/cxgb4 1 file changed +7
-9
lines changed Original file line number Diff line number Diff line change @@ -4057,22 +4057,19 @@ int cxgb4_unregister_uld(enum cxgb4_uld type)
4057
4057
EXPORT_SYMBOL (cxgb4_unregister_uld );
4058
4058
4059
4059
/* Check if netdev on which event is occured belongs to us or not. Return
4060
- * suceess (1) if it belongs otherwise failure (0).
4060
+ * success (true) if it belongs otherwise failure (false).
4061
+ * Called with rcu_read_lock() held.
4061
4062
*/
4062
- static int cxgb4_netdev (struct net_device * netdev )
4063
+ static bool cxgb4_netdev (const struct net_device * netdev )
4063
4064
{
4064
4065
struct adapter * adap ;
4065
4066
int i ;
4066
4067
4067
- spin_lock (& adap_rcu_lock );
4068
4068
list_for_each_entry_rcu (adap , & adap_rcu_list , rcu_node )
4069
4069
for (i = 0 ; i < MAX_NPORTS ; i ++ )
4070
- if (adap -> port [i ] == netdev ) {
4071
- spin_unlock (& adap_rcu_lock );
4072
- return 1 ;
4073
- }
4074
- spin_unlock (& adap_rcu_lock );
4075
- return 0 ;
4070
+ if (adap -> port [i ] == netdev )
4071
+ return true;
4072
+ return false;
4076
4073
}
4077
4074
4078
4075
static int clip_add (struct net_device * event_dev , struct inet6_ifaddr * ifa ,
@@ -6396,6 +6393,7 @@ static void remove_one(struct pci_dev *pdev)
6396
6393
adapter -> flags &= ~DEV_ENABLED ;
6397
6394
}
6398
6395
pci_release_regions (pdev );
6396
+ synchronize_rcu ();
6399
6397
kfree (adapter );
6400
6398
} else
6401
6399
pci_release_regions (pdev );
You can’t perform that action at this time.
0 commit comments