Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 58615256 authored by Martin Habets's avatar Martin Habets Committed by David S. Miller
Browse files

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

parent 06a1be16
Loading
Loading
Loading
Loading
+9 −6
Original line number Diff line number Diff line
@@ -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';

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

		kfree(tmp);
		kfree(str);