From ed6a1ed193ff8a8a2733bdd5a247b77137e72613 Mon Sep 17 00:00:00 2001 From: Ayush Kumar Date: Tue, 27 Oct 2020 17:24:46 +0530 Subject: [PATCH] msm: camera: isp: Validate the ife bw blob data If ife bandwidth number of paths configuration is zero then do not proceed. Number of bandwidth paths should be minimum one and should not be greater than max value. CRs-Fixed: 2801769 Change-Id: I2bf5cd4ea76ca7ecd9ca968bced2957a76691001 Signed-off-by: Ayush Kumar --- drivers/cam_isp/isp_hw_mgr/cam_ife_hw_mgr.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/drivers/cam_isp/isp_hw_mgr/cam_ife_hw_mgr.c b/drivers/cam_isp/isp_hw_mgr/cam_ife_hw_mgr.c index 40f1d24701e6..ca5fadfb7a85 100644 --- a/drivers/cam_isp/isp_hw_mgr/cam_ife_hw_mgr.c +++ b/drivers/cam_isp/isp_hw_mgr/cam_ife_hw_mgr.c @@ -5962,7 +5962,8 @@ static int cam_isp_packet_generic_blob_handler(void *user_data, if (!prepare || !prepare->priv || (bw_config->usage_type >= CAM_IFE_HW_NUM_MAX)) { - CAM_ERR(CAM_ISP, "Invalid inputs"); + CAM_ERR(CAM_ISP, "Invalid inputs usage type %d", + bw_config->usage_type); return -EINVAL; } @@ -5987,7 +5988,8 @@ static int cam_isp_packet_generic_blob_handler(void *user_data, bw_config = (struct cam_isp_bw_config_v2 *)blob_data; - if (bw_config->num_paths > CAM_ISP_MAX_PER_PATH_VOTES) { + if (bw_config->num_paths > CAM_ISP_MAX_PER_PATH_VOTES || + !bw_config->num_paths) { CAM_ERR(CAM_ISP, "Invalid num paths %d", bw_config->num_paths); return -EINVAL; @@ -6022,7 +6024,8 @@ static int cam_isp_packet_generic_blob_handler(void *user_data, if (!prepare || !prepare->priv || (bw_config->usage_type >= CAM_IFE_HW_NUM_MAX)) { - CAM_ERR(CAM_ISP, "Invalid inputs"); + CAM_ERR(CAM_ISP, "Invalid inputs usage type %d", + bw_config->usage_type); return -EINVAL; }