aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net')
-rw-r--r--drivers/net/ppp_generic.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/drivers/net/ppp_generic.c b/drivers/net/ppp_generic.c
index 3ee7830d458d..c832d600d1e8 100644
--- a/drivers/net/ppp_generic.c
+++ b/drivers/net/ppp_generic.c
@@ -179,7 +179,7 @@ struct channel {
179 */ 179 */
180static DEFINE_MUTEX(all_ppp_mutex); 180static DEFINE_MUTEX(all_ppp_mutex);
181static atomic_t ppp_unit_count = ATOMIC_INIT(0); 181static atomic_t ppp_unit_count = ATOMIC_INIT(0);
182static struct idr ppp_units_idr; 182static DEFINE_IDR(ppp_units_idr);
183 183
184/* 184/*
185 * all_channels_lock protects all_channels and last_channel_index, 185 * all_channels_lock protects all_channels and last_channel_index,
@@ -852,8 +852,6 @@ static int __init ppp_init(void)
852 "ppp"); 852 "ppp");
853 } 853 }
854 854
855 idr_init(&ppp_units_idr);
856
857out: 855out:
858 if (err) 856 if (err)
859 printk(KERN_ERR "failed to register PPP device (%d)\n", err); 857 printk(KERN_ERR "failed to register PPP device (%d)\n", err);
@@ -2435,7 +2433,7 @@ ppp_create_interface(int unit, int *retp)
2435 if (unit_find(&ppp_units_idr, unit)) 2433 if (unit_find(&ppp_units_idr, unit))
2436 goto out2; /* unit already exists */ 2434 goto out2; /* unit already exists */
2437 else { 2435 else {
2438 /* darn, someone is cheatting us? */ 2436 /* darn, someone is cheating us? */
2439 *retp = -EINVAL; 2437 *retp = -EINVAL;
2440 goto out2; 2438 goto out2;
2441 } 2439 }