diff --git a/drivers/cam_sensor_module/cam_tpg/tpg_hw/tpg_hw.c b/drivers/cam_sensor_module/cam_tpg/tpg_hw/tpg_hw.c index 4a84e8e0b6..afc9fa9402 100644 --- a/drivers/cam_sensor_module/cam_tpg/tpg_hw/tpg_hw.c +++ b/drivers/cam_sensor_module/cam_tpg/tpg_hw/tpg_hw.c @@ -1330,7 +1330,7 @@ struct tpg_hw_request *tpg_hw_create_request( uint64_t request_id) { struct tpg_hw_request *req = NULL; - uint32_t num_vc_channels = hw->hw_info->max_vc_channels; + uint32_t num_vc_channels = 0; uint32_t i = 0; if (!hw) { @@ -1338,6 +1338,8 @@ struct tpg_hw_request *tpg_hw_create_request( return NULL; } + num_vc_channels = hw->hw_info->max_vc_channels; + /* Allocate request */ req = kzalloc(sizeof(struct tpg_hw_request), GFP_KERNEL); diff --git a/drivers/cam_sensor_module/cam_tpg/tpg_hw/tpg_hw_v_1_4/tpg_hw_v_1_4.c b/drivers/cam_sensor_module/cam_tpg/tpg_hw/tpg_hw_v_1_4/tpg_hw_v_1_4.c index c1bf546918..49fef9dc17 100644 --- a/drivers/cam_sensor_module/cam_tpg/tpg_hw/tpg_hw_v_1_4/tpg_hw_v_1_4.c +++ b/drivers/cam_sensor_module/cam_tpg/tpg_hw/tpg_hw_v_1_4/tpg_hw_v_1_4.c @@ -941,6 +941,7 @@ int tpg_1_4_layer_init(struct tpg_hw *hw) if (!dbgfileptr_parent) { CAM_ERR(CAM_TPG, "Debug fs could not create directory"); rc = -ENOENT; + return rc; } debugfs_create_file("tpg_xcfa_test", 0644, dbgfileptr_parent, hw, &tpg_1_4_xcfa_test);