Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 201393
b: refs/heads/master
c: 4b4fd27
h: refs/heads/master
i:
  201391: e00343e
v: v3
  • Loading branch information
Helge Deller authored and Linus Torvalds committed Aug 3, 2010
1 parent 24f5f6e commit 5165565
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 9fe6206f400646a2322096b56c59891d530e8d51
refs/heads/master: 4b4fd27c0b5ec638a1f06ced9226fd95229dbbf0
6 changes: 4 additions & 2 deletions trunk/drivers/parisc/led.c
Original file line number Diff line number Diff line change
Expand Up @@ -176,16 +176,18 @@ static ssize_t led_proc_write(struct file *file, const char *buf,
size_t count, loff_t *pos)
{
void *data = PDE(file->f_path.dentry->d_inode)->data;
char *cur, lbuf[count + 1];
char *cur, lbuf[32];
int d;

if (!capable(CAP_SYS_ADMIN))
return -EACCES;

memset(lbuf, 0, count + 1);
if (count >= sizeof(lbuf))
count = sizeof(lbuf)-1;

if (copy_from_user(lbuf, buf, count))
return -EFAULT;
lbuf[count] = 0;

cur = lbuf;

Expand Down

0 comments on commit 5165565

Please sign in to comment.