提交 58615256 编写于 作者: M Martin Habets 提交者: David S. Miller

[SPARC]: Fix warning on prom_getproperty in openprom.c

Signed-off-by: NMartin Habets <errandir_news@mph.eclipse.co.uk>
Signed-off-by: NDavid S. Miller <davem@davemloft.net>
上级 06a1be16
......@@ -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);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册