Merge "msm: sensor: Fix for variable being de-referenced without proper check"
This commit is contained in:
commit
1b7d2301c4
2 changed files with 7 additions and 9 deletions
|
@ -1,4 +1,4 @@
|
||||||
/* Copyright (c) 2009-2016, The Linux Foundation. All rights reserved.
|
/* Copyright (c) 2009-2017, The Linux Foundation. All rights reserved.
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* 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
|
* it under the terms of the GNU General Public License version 2 and
|
||||||
|
@ -1144,13 +1144,13 @@ static long msm_flash_subdev_do_ioctl(
|
||||||
sd = vdev_to_v4l2_subdev(vdev);
|
sd = vdev_to_v4l2_subdev(vdev);
|
||||||
u32 = (struct msm_flash_cfg_data_t32 *)arg;
|
u32 = (struct msm_flash_cfg_data_t32 *)arg;
|
||||||
|
|
||||||
flash_data.cfg_type = u32->cfg_type;
|
|
||||||
for (i = 0; i < MAX_LED_TRIGGERS; i++) {
|
|
||||||
flash_data.flash_current[i] = u32->flash_current[i];
|
|
||||||
flash_data.flash_duration[i] = u32->flash_duration[i];
|
|
||||||
}
|
|
||||||
switch (cmd) {
|
switch (cmd) {
|
||||||
case VIDIOC_MSM_FLASH_CFG32:
|
case VIDIOC_MSM_FLASH_CFG32:
|
||||||
|
flash_data.cfg_type = u32->cfg_type;
|
||||||
|
for (i = 0; i < MAX_LED_TRIGGERS; i++) {
|
||||||
|
flash_data.flash_current[i] = u32->flash_current[i];
|
||||||
|
flash_data.flash_duration[i] = u32->flash_duration[i];
|
||||||
|
}
|
||||||
cmd = VIDIOC_MSM_FLASH_CFG;
|
cmd = VIDIOC_MSM_FLASH_CFG;
|
||||||
switch (flash_data.cfg_type) {
|
switch (flash_data.cfg_type) {
|
||||||
case CFG_FLASH_OFF:
|
case CFG_FLASH_OFF:
|
||||||
|
|
|
@ -774,11 +774,10 @@ static long msm_ois_subdev_do_ioctl(
|
||||||
u32 = (struct msm_ois_cfg_data32 *)arg;
|
u32 = (struct msm_ois_cfg_data32 *)arg;
|
||||||
parg = arg;
|
parg = arg;
|
||||||
|
|
||||||
ois_data.cfgtype = u32->cfgtype;
|
|
||||||
|
|
||||||
switch (cmd) {
|
switch (cmd) {
|
||||||
case VIDIOC_MSM_OIS_CFG32:
|
case VIDIOC_MSM_OIS_CFG32:
|
||||||
cmd = VIDIOC_MSM_OIS_CFG;
|
cmd = VIDIOC_MSM_OIS_CFG;
|
||||||
|
ois_data.cfgtype = u32->cfgtype;
|
||||||
|
|
||||||
switch (u32->cfgtype) {
|
switch (u32->cfgtype) {
|
||||||
case CFG_OIS_CONTROL:
|
case CFG_OIS_CONTROL:
|
||||||
|
@ -812,7 +811,6 @@ static long msm_ois_subdev_do_ioctl(
|
||||||
settings.reg_setting =
|
settings.reg_setting =
|
||||||
compat_ptr(settings32.reg_setting);
|
compat_ptr(settings32.reg_setting);
|
||||||
|
|
||||||
ois_data.cfgtype = u32->cfgtype;
|
|
||||||
ois_data.cfg.settings = &settings;
|
ois_data.cfg.settings = &settings;
|
||||||
parg = &ois_data;
|
parg = &ois_data;
|
||||||
break;
|
break;
|
||||||
|
|
Loading…
Add table
Reference in a new issue