mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-29 19:21:31 -04:00
[SPARC]: Fix warning on prom_getproperty in openprom.c
Signed-off-by: Martin Habets <[email protected]> Signed-off-by: David S. Miller <[email protected]>
This commit is contained in:
parent
06a1be167e
commit
586152560a
1 changed files with 9 additions and 6 deletions
|
|
@ -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);
|
||||
cnt = prom_getproperty(op.op_nodeid, str, tmp, len);
|
||||
if (cnt <= 0) {
|
||||
error = -EINVAL;
|
||||
} else {
|
||||
tmp[len] = '\0';
|
||||
|
||||
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);
|
||||
|
|
|
|||
Loading…
Reference in a new issue