ion_test_ioctl() copies the data to userspace if ioctl command
includes read property. But it copies incorrect number of bytes
because 'data' in sizeof(data) is union of various length data
structures.
Change-Id: I3bcafa6823a38b8ce949f90086dbc9f4c5d3e8c3
Signed-off-by: Cho KyongHo <pullip.cho@samsung.com>
}
if (_IOC_DIR(cmd) & _IOC_READ) {
- if (copy_to_user((void __user *)arg, &data, sizeof(data)))
+ if (copy_to_user((void __user *)arg, &data, _IOC_SIZE(cmd)))
return -EFAULT;
}
return ret;