aboutsummaryrefslogtreecommitdiffstats
path: root/net/irda/irnet/irnet_ppp.c
diff options
context:
space:
mode:
Diffstat (limited to 'net/irda/irnet/irnet_ppp.c')
-rw-r--r--net/irda/irnet/irnet_ppp.c14
1 files changed, 8 insertions, 6 deletions
diff --git a/net/irda/irnet/irnet_ppp.c b/net/irda/irnet/irnet_ppp.c
index 7dea882dbb75..6a1a202710c5 100644
--- a/net/irda/irnet/irnet_ppp.c
+++ b/net/irda/irnet/irnet_ppp.c
@@ -14,6 +14,7 @@
14 */ 14 */
15 15
16#include <linux/sched.h> 16#include <linux/sched.h>
17#include <linux/slab.h>
17#include <linux/smp_lock.h> 18#include <linux/smp_lock.h>
18#include "irnet_ppp.h" /* Private header */ 19#include "irnet_ppp.h" /* Private header */
19/* Please put other headers in irnet.h - Thanks */ 20/* Please put other headers in irnet.h - Thanks */
@@ -76,9 +77,8 @@ irnet_ctrl_write(irnet_socket * ap,
76 /* Look at the next command */ 77 /* Look at the next command */
77 start = next; 78 start = next;
78 79
79 /* Scrap whitespaces before the command */ 80 /* Scrap whitespaces before the command */
80 while(isspace(*start)) 81 start = skip_spaces(start);
81 start++;
82 82
83 /* ',' is our command separator */ 83 /* ',' is our command separator */
84 next = strchr(start, ','); 84 next = strchr(start, ',');
@@ -133,8 +133,7 @@ irnet_ctrl_write(irnet_socket * ap,
133 char * endp; 133 char * endp;
134 134
135 /* Scrap whitespaces before the command */ 135 /* Scrap whitespaces before the command */
136 while(isspace(*begp)) 136 begp = skip_spaces(begp);
137 begp++;
138 137
139 /* Convert argument to a number (last arg is the base) */ 138 /* Convert argument to a number (last arg is the base) */
140 addr = simple_strtoul(begp, &endp, 16); 139 addr = simple_strtoul(begp, &endp, 16);
@@ -700,15 +699,18 @@ dev_irnet_ioctl(
700 699
701 /* Query PPP channel and unit number */ 700 /* Query PPP channel and unit number */
702 case PPPIOCGCHAN: 701 case PPPIOCGCHAN:
702 lock_kernel();
703 if(ap->ppp_open && !put_user(ppp_channel_index(&ap->chan), 703 if(ap->ppp_open && !put_user(ppp_channel_index(&ap->chan),
704 (int __user *)argp)) 704 (int __user *)argp))
705 err = 0; 705 err = 0;
706 unlock_kernel();
706 break; 707 break;
707 case PPPIOCGUNIT: 708 case PPPIOCGUNIT:
708 lock_kernel(); 709 lock_kernel();
709 if(ap->ppp_open && !put_user(ppp_unit_number(&ap->chan), 710 if(ap->ppp_open && !put_user(ppp_unit_number(&ap->chan),
710 (int __user *)argp)) 711 (int __user *)argp))
711 err = 0; 712 err = 0;
713 unlock_kernel();
712 break; 714 break;
713 715
714 /* All these ioctls can be passed both directly and from ppp_generic, 716 /* All these ioctls can be passed both directly and from ppp_generic,