refcount = atomic_dec_return(&hw_ip->rsccount);
if (refcount == 0) {
u32 group_id = get_group_id_from_hw_ip(hw_ip->id);
+ if (group_id >= GROUP_ID_MAX) {
+ merr_hw("[ID:%d]invalid group_id %d", instance, hw_ip->id, group_id);
+ return -EINVAL;
+ }
msdbg_hw(1, "%s: [G:0x%x], framemgr[ID:0x%x]->framemgr[ID:0x%x]\n",
instance, hw_ip, __func__, GROUP_ID(group_id),
set_bit(FIMC_IS_SENSOR_ACTUATOR_AVAILABLE, &sensor_peri->peri_state);
snprintf(subdev_actuator->name, V4L2_SUBDEV_NAME_SIZE, "actuator-subdev.%d", actuator->id);
-p_err:
+
probe_info("%s done\n", __func__);
return ret;
+
+p_err:
+ if (subdev_actuator)
+ kzfree(subdev_actuator);
+
+ return ret;
}
static const struct of_device_id sensor_actuator_dw9714_match[] = {
set_bit(FIMC_IS_SENSOR_ACTUATOR_AVAILABLE, &sensor_peri->peri_state);
snprintf(subdev_actuator->name, V4L2_SUBDEV_NAME_SIZE, "actuator-subdev.%d", actuator->id);
-p_err:
+
probe_info("%s done\n", __func__);
return ret;
+
+p_err:
+ if (subdev_actuator)
+ kzfree(subdev_actuator);
+
+ return ret;
}
static const struct of_device_id sensor_actuator_dw9804_match[] = {
set_bit(FIMC_IS_SENSOR_ACTUATOR_AVAILABLE, &sensor_peri->peri_state);
snprintf(subdev_actuator->name, V4L2_SUBDEV_NAME_SIZE, "actuator-subdev.%d", actuator->id);
-p_err:
+
probe_info("%s done\n", __func__);
return ret;
+
+p_err:
+ if (subdev_actuator)
+ kzfree(subdev_actuator);
+
+ return ret;
}
static const struct of_device_id sensor_actuator_dw9807_match[] = {
set_bit(FIMC_IS_SENSOR_ACTUATOR_AVAILABLE, &sensor_peri->peri_state);
snprintf(subdev_actuator->name, V4L2_SUBDEV_NAME_SIZE, "actuator-subdev.%d", actuator->id);
-p_err:
+
probe_info("%s done\n", __func__);
return ret;
+
+p_err:
+ if (actuator && actuator->priv_info)
+ vfree(actuator->priv_info);
+
+ if (actuator)
+ kzfree(actuator);
+
+ if (subdev_actuator)
+ kzfree(subdev_actuator);
+
+ return ret;
}
static const struct of_device_id sensor_actuator_dw9839_match[] = {
set_bit(FIMC_IS_SENSOR_ACTUATOR_AVAILABLE, &sensor_peri->peri_state);
snprintf(subdev_actuator->name, V4L2_SUBDEV_NAME_SIZE, "actuator-subdev.%d", actuator->id);
-p_err:
+
probe_info("%s done\n", __func__);
return ret;
+
+p_err:
+ if (actuator)
+ kzfree(actuator);
+
+ if (subdev_actuator)
+ kzfree(subdev_actuator);
+
+ return ret;
}
static const struct of_device_id sensor_actuator_lc898217_match[] = {
v4l2_set_subdev_hostdata(subdev_actuator, device);
snprintf(subdev_actuator->name, V4L2_SUBDEV_NAME_SIZE, "actuator-subdev.%d", actuator->id);
-p_err:
+
probe_info("%s done\n", __func__);
return ret;
+
+p_err:
+ if (actuator)
+ kzfree(actuator);
+
+ if (subdev_actuator)
+ kzfree(subdev_actuator);
+
+ return ret;
}
static const struct of_device_id sensor_actuator_zc533_match[] = {
snprintf(subdev_actuator->name, V4L2_SUBDEV_NAME_SIZE, "actuator-subdev.%d", actuator->id);
-p_err:
probe_info("%s done\n", __func__);
return ret;
+
+p_err:
+ if (actuator)
+ kzfree(actuator);
+
+ if (subdev_actuator)
+ kzfree(subdev_actuator);
+
+ return ret;
}
static int sensor_zc569_actuator_remove(struct i2c_client *client)