aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/parisc
diff options
context:
space:
mode:
authorJiri Kosina <jkosina@suse.cz>2010-08-04 09:14:38 -0400
committerJiri Kosina <jkosina@suse.cz>2010-08-04 09:14:38 -0400
commitd790d4d583aeaed9fc6f8a9f4d9f8ce6b1c15c7f (patch)
tree854ab394486288d40fa8179cbfaf66e8bdc44b0f /drivers/parisc
parent73b2c7165b76b20eb1290e7efebc33cfd21db1ca (diff)
parent3a09b1be53d23df780a0cd0e4087a05e2ca4a00c (diff)
Merge branch 'master' into for-next
Diffstat (limited to 'drivers/parisc')
-rw-r--r--drivers/parisc/led.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/drivers/parisc/led.c b/drivers/parisc/led.c
index 188bc8496a26..d02be78a4138 100644
--- a/drivers/parisc/led.c
+++ b/drivers/parisc/led.c
@@ -176,16 +176,18 @@ static ssize_t led_proc_write(struct file *file, const char *buf,
176 size_t count, loff_t *pos) 176 size_t count, loff_t *pos)
177{ 177{
178 void *data = PDE(file->f_path.dentry->d_inode)->data; 178 void *data = PDE(file->f_path.dentry->d_inode)->data;
179 char *cur, lbuf[count + 1]; 179 char *cur, lbuf[32];
180 int d; 180 int d;
181 181
182 if (!capable(CAP_SYS_ADMIN)) 182 if (!capable(CAP_SYS_ADMIN))
183 return -EACCES; 183 return -EACCES;
184 184
185 memset(lbuf, 0, count + 1); 185 if (count >= sizeof(lbuf))
186 count = sizeof(lbuf)-1;
186 187
187 if (copy_from_user(lbuf, buf, count)) 188 if (copy_from_user(lbuf, buf, count))
188 return -EFAULT; 189 return -EFAULT;
190 lbuf[count] = 0;
189 191
190 cur = lbuf; 192 cur = lbuf;
191 193