diff options
Diffstat (limited to 'net/wanrouter/wanmain.c')
| -rw-r--r-- | net/wanrouter/wanmain.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/net/wanrouter/wanmain.c b/net/wanrouter/wanmain.c index 258daa80ad92..2bf23406637a 100644 --- a/net/wanrouter/wanmain.c +++ b/net/wanrouter/wanmain.c | |||
| @@ -48,7 +48,7 @@ | |||
| 48 | #include <linux/kernel.h> | 48 | #include <linux/kernel.h> |
| 49 | #include <linux/module.h> /* support for loadable modules */ | 49 | #include <linux/module.h> /* support for loadable modules */ |
| 50 | #include <linux/slab.h> /* kmalloc(), kfree() */ | 50 | #include <linux/slab.h> /* kmalloc(), kfree() */ |
| 51 | #include <linux/smp_lock.h> | 51 | #include <linux/mutex.h> |
| 52 | #include <linux/mm.h> | 52 | #include <linux/mm.h> |
| 53 | #include <linux/string.h> /* inline mem*, str* functions */ | 53 | #include <linux/string.h> /* inline mem*, str* functions */ |
| 54 | 54 | ||
| @@ -71,6 +71,7 @@ | |||
| 71 | * WAN device IOCTL handlers | 71 | * WAN device IOCTL handlers |
| 72 | */ | 72 | */ |
| 73 | 73 | ||
| 74 | static DEFINE_MUTEX(wanrouter_mutex); | ||
| 74 | static int wanrouter_device_setup(struct wan_device *wandev, | 75 | static int wanrouter_device_setup(struct wan_device *wandev, |
| 75 | wandev_conf_t __user *u_conf); | 76 | wandev_conf_t __user *u_conf); |
| 76 | static int wanrouter_device_stat(struct wan_device *wandev, | 77 | static int wanrouter_device_stat(struct wan_device *wandev, |
| @@ -376,7 +377,7 @@ long wanrouter_ioctl(struct file *file, unsigned int cmd, unsigned long arg) | |||
| 376 | if (wandev->magic != ROUTER_MAGIC) | 377 | if (wandev->magic != ROUTER_MAGIC) |
| 377 | return -EINVAL; | 378 | return -EINVAL; |
| 378 | 379 | ||
| 379 | lock_kernel(); | 380 | mutex_lock(&wanrouter_mutex); |
| 380 | switch (cmd) { | 381 | switch (cmd) { |
| 381 | case ROUTER_SETUP: | 382 | case ROUTER_SETUP: |
| 382 | err = wanrouter_device_setup(wandev, data); | 383 | err = wanrouter_device_setup(wandev, data); |
| @@ -408,7 +409,7 @@ long wanrouter_ioctl(struct file *file, unsigned int cmd, unsigned long arg) | |||
| 408 | err = wandev->ioctl(wandev, cmd, arg); | 409 | err = wandev->ioctl(wandev, cmd, arg); |
| 409 | else err = -EINVAL; | 410 | else err = -EINVAL; |
| 410 | } | 411 | } |
| 411 | unlock_kernel(); | 412 | mutex_unlock(&wanrouter_mutex); |
| 412 | return err; | 413 | return err; |
| 413 | } | 414 | } |
| 414 | 415 | ||
