The function mxc_hdmi_ioctl is passing kernel memory to user-space. The
case for HDMI_IOC_GET_CPU_TYPE is passing the memory directly, which is
not permitted. Fixed this, by using put_user().
Signed-off-by: Robert Chiras <robert.chiras@nxp.com>
sizeof(g_hdmi->hdmi_data)) ? -EFAULT : 0;
break;
case HDMI_IOC_GET_CPU_TYPE:
- *argp = g_hdmi->cpu_type;
+ ret = put_user(g_hdmi->cpu_type, argp);
break;
default:
pr_debug("Unsupport cmd %d\n", cmd);
break;
- }
- return ret;
+ }
+
+ return ret;
}
static int mxc_hdmi_release(struct inode *inode, struct file *file)