projects
/
firefly-linux-kernel-4.4.55.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
06a1be1
)
[SPARC]: Fix warning on prom_getproperty in openprom.c
author
Martin Habets
<errandir_news@mph.eclipse.co.uk>
Fri, 12 May 2006 19:53:59 +0000
(12:53 -0700)
committer
David S. Miller
<davem@davemloft.net>
Fri, 12 May 2006 19:53:59 +0000
(12:53 -0700)
Signed-off-by: Martin Habets <errandir_news@mph.eclipse.co.uk>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/sbus/char/openprom.c
patch
|
blob
|
history
diff --git
a/drivers/sbus/char/openprom.c
b/drivers/sbus/char/openprom.c
index 383a95f34a0da4e8adec682df992786d572efe27..239e108b8ed1e16cb45d51fa89591418a5410bac 100644
(file)
--- 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);