msm: ais: ispif: Fix invalid type conversion
Due to improper type conversion compilation issue will be seen. Made change to access the appropriate type. Change-Id: I54777fe71a2f29297b439ac26f80b9684222d89a Signed-off-by: E V Ravi <evenka@codeaurora.org>
This commit is contained in:
parent
e3357a357e
commit
0655daaa91
1 changed files with 25 additions and 22 deletions
|
@ -1,4 +1,4 @@
|
|||
/* Copyright (c) 2013-2018, The Linux Foundation. All rights reserved.
|
||||
/* Copyright (c) 2013-2019, The Linux Foundation. All rights reserved.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License version 2 and
|
||||
|
@ -215,32 +215,35 @@ static long msm_ispif_cmd_ext(struct v4l2_subdev *sd,
|
|||
long rc = 0;
|
||||
struct ispif_device *ispif =
|
||||
(struct ispif_device *)v4l2_get_subdevdata(sd);
|
||||
struct ispif_cfg_data_ext pcdata;
|
||||
struct ispif_cfg_data_ext pcdata = {0};
|
||||
struct msm_ispif_param_data_ext *params = NULL;
|
||||
|
||||
if (is_compat_task()) {
|
||||
#ifdef CONFIG_COMPAT
|
||||
struct ispif_cfg_data_ext_32 *pcdata32 =
|
||||
(struct ispif_cfg_data_ext_32 *)arg;
|
||||
struct ispif_cfg_data_ext_32 *pcdata32 =
|
||||
(struct ispif_cfg_data_ext_32 *)arg;
|
||||
|
||||
if (pcdata32 == NULL) {
|
||||
pr_err("Invalid params passed from user\n");
|
||||
return -EINVAL;
|
||||
}
|
||||
pcdata.cfg_type = pcdata32->cfg_type;
|
||||
pcdata.size = pcdata32->size;
|
||||
pcdata.data = compat_ptr(pcdata32->data);
|
||||
if (pcdata32 == NULL) {
|
||||
pr_err("Invalid params passed from user\n");
|
||||
return -EINVAL;
|
||||
}
|
||||
pcdata.cfg_type = pcdata32->cfg_type;
|
||||
pcdata.size = pcdata32->size;
|
||||
pcdata.data = compat_ptr(pcdata32->data);
|
||||
|
||||
#else
|
||||
struct ispif_cfg_data_ext *pcdata64 =
|
||||
(struct ispif_cfg_data_ext *)arg;
|
||||
|
||||
if (pcdata64 == NULL) {
|
||||
pr_err("Invalid params passed from user\n");
|
||||
return -EINVAL;
|
||||
}
|
||||
pcdata.cfg_type = pcdata64->cfg_type;
|
||||
pcdata.size = pcdata64->size;
|
||||
pcdata.data = pcdata64->data;
|
||||
#endif
|
||||
} else {
|
||||
struct ispif_cfg_data_ext *pcdata64 =
|
||||
(struct ispif_cfg_data_ext *)arg;
|
||||
|
||||
if (pcdata64 == NULL) {
|
||||
pr_err("Invalid params passed from user\n");
|
||||
return -EINVAL;
|
||||
}
|
||||
pcdata.cfg_type = pcdata64->cfg_type;
|
||||
pcdata.size = pcdata64->size;
|
||||
pcdata.data = pcdata64->data;
|
||||
}
|
||||
if (pcdata.size != sizeof(struct msm_ispif_param_data_ext)) {
|
||||
pr_err("%s: payload size mismatch\n", __func__);
|
||||
return -EINVAL;
|
||||
|
|
Loading…
Add table
Reference in a new issue