mirror of
https://github.com/team-infusion-developers/android_kernel_samsung_msm8976.git
synced 2024-09-21 03:43:03 +00:00
msm: camera: isp: Fix command length check.
The driver interface for getting MAX clock is 32 bit value. Check for userspace container is modified to verify agains that type and not against long which can be with different size. Change-Id: Ieb0b11cc93d6c334e158f3067d33a198fefa4fdc Signed-off-by: Petar Sivenov <psiven@codeaurora.org>
This commit is contained in:
parent
ee794fa190
commit
18e2d23364
|
@ -894,19 +894,22 @@ static int msm_isp_send_hw_cmd(struct vfe_device *vfe_dev,
|
|||
}
|
||||
case GET_MAX_CLK_RATE: {
|
||||
int rc = 0;
|
||||
unsigned long rate;
|
||||
|
||||
if (cmd_len < sizeof(unsigned long)) {
|
||||
if (cmd_len != sizeof(__u32)) {
|
||||
pr_err("%s:%d failed: invalid cmd len %u exp %zu\n",
|
||||
__func__, __LINE__, cmd_len,
|
||||
sizeof(unsigned long));
|
||||
sizeof(__u32));
|
||||
return -EINVAL;
|
||||
}
|
||||
rc = msm_isp_get_max_clk_rate(vfe_dev,
|
||||
(unsigned long *)cfg_data);
|
||||
rc = msm_isp_get_max_clk_rate(vfe_dev, &rate);
|
||||
if (rc < 0) {
|
||||
pr_err("%s:%d failed: rc %d\n", __func__, __LINE__, rc);
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
*(__u32 *)cfg_data = (__u32)rate;
|
||||
|
||||
break;
|
||||
}
|
||||
case GET_ISP_ID: {
|
||||
|
|
Loading…
Reference in a new issue