Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 26686
b: refs/heads/master
c: 5861525
h: refs/heads/master
v: v3
  • Loading branch information
Martin Habets authored and David S. Miller committed May 12, 2006
1 parent c71e21e commit fa99325
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 7 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: 06a1be167ea77c436657587e26cd4d7d6401784c
refs/heads/master: 586152560ae8df2a9babf1a8b667d7a145cb8208
15 changes: 9 additions & 6 deletions trunk/drivers/sbus/char/openprom.c
Original file line number Diff line number Diff line change
Expand Up @@ -392,13 +392,16 @@ static int openprom_bsd_ioctl(struct inode * inode, struct file * file,
return -ENOMEM;
}

prom_getproperty(op.op_nodeid, str, tmp, len);

tmp[len] = '\0';
cnt = prom_getproperty(op.op_nodeid, str, tmp, len);
if (cnt <= 0) {
error = -EINVAL;
} else {
tmp[len] = '\0';

if (__copy_to_user(argp, &op, sizeof(op)) != 0
|| copy_to_user(op.op_buf, tmp, len) != 0)
error = -EFAULT;
if (__copy_to_user(argp, &op, sizeof(op)) != 0 ||
copy_to_user(op.op_buf, tmp, len) != 0)
error = -EFAULT;
}

kfree(tmp);
kfree(str);
Expand Down

0 comments on commit fa99325

Please sign in to comment.