summaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@g5.osdl.org>2006-05-13 00:26:29 +0200
committerLinus Torvalds <torvalds@g5.osdl.org>2006-05-13 00:26:29 +0200
commitfaa88df860fdfad13afc99fc7201432f9263b3b5 (patch)
tree0c5b480922c4a2d65154f610ae04928790de96da /drivers
parentIB: refcount race fixes (diff)
parent[SPARC]: Fix warning on prom_getproperty in openprom.c (diff)
downloadlinux-faa88df860fdfad13afc99fc7201432f9263b3b5.tar.xz
linux-faa88df860fdfad13afc99fc7201432f9263b3b5.zip
Merge master.kernel.org:/pub/scm/linux/kernel/git/davem/sparc-2.6
* master.kernel.org:/pub/scm/linux/kernel/git/davem/sparc-2.6: [SPARC]: Fix warning on prom_getproperty in openprom.c [SPARC]: Handle UNWIND_INFO properly. [SPARC64]: Update defconfig. [SPARC]: show device name in /proc/dvma_map [SPARC]: Remove duplicate symbol exports
Diffstat (limited to 'drivers')
-rw-r--r--drivers/sbus/char/openprom.c15
1 files changed, 9 insertions, 6 deletions
diff --git a/drivers/sbus/char/openprom.c b/drivers/sbus/char/openprom.c
index 383a95f34a0d..239e108b8ed1 100644
--- a/drivers/sbus/char/openprom.c
+++ b/drivers/sbus/char/openprom.c
@@ -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);