OSDN Git Service
(root)
/
sagit-ice-cold
/
kernel_xiaomi_msm8998.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
dfabe2c
)
ais: sensor: fixing invalid address access issue during cci read
author
Andy Sun
<bins@codeaurora.org>
Thu, 7 Jun 2018 06:33:04 +0000
(14:33 +0800)
committer
Andy Sun
<bins@codeaurora.org>
Fri, 8 Jun 2018 02:51:33 +0000
(10:51 +0800)
Should use copy_to_user to pass data to userspace pointer.
Change-Id: Ide5fe1b1f4c76e5c75cfa634ac6913b0908e0d72
Signed-off-by: Andy Sun <bins@codeaurora.org>
drivers/media/platform/msm/ais/sensor/msm_sensor.c
patch
|
blob
|
history
diff --git
a/drivers/media/platform/msm/ais/sensor/msm_sensor.c
b/drivers/media/platform/msm/ais/sensor/msm_sensor.c
index
0dda3a6
..
7434ba4
100644
(file)
--- a/
drivers/media/platform/msm/ais/sensor/msm_sensor.c
+++ b/
drivers/media/platform/msm/ais/sensor/msm_sensor.c
@@
-1242,7
+1242,12
@@
int msm_sensor_config(struct msm_sensor_ctrl_t *s_ctrl, void *argp)
pr_err("%s:%d: i2c_read failed\n", __func__, __LINE__);
break;
}
- read_config_ptr->data = local_data;
+ if (copy_to_user((void __user *)&read_config_ptr->data,
+ &local_data, sizeof(local_data))) {
+ pr_err("%s:%d failed\n", __func__, __LINE__);
+ rc = -EFAULT;
+ break;
+ }
break;
}
case CFG_SLAVE_WRITE_I2C_ARRAY: {