From 3dd3448144c1288ac561a309b97f44760356cbb4 Mon Sep 17 00:00:00 2001 From: Stark Lin Date: Fri, 22 Jul 2022 12:45:18 +0800 Subject: [PATCH] msm: camera: isp: Fix null pointer issue Null pointer might be used uninitialized in case param input is null, now we will return with -EINVAL directly to avoid passing null pointer to other function. CRs-Fixed: 3250360 Change-Id: I19bd6f83d2f6315f55f05559b6984e721ca3d143 Signed-off-by: Stark Lin Signed-off-by: Depeng Shao --- .../isp_hw_mgr/isp_hw/ife_csid_hw/cam_ife_csid_hw_ver2.c | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/drivers/cam_isp/isp_hw_mgr/isp_hw/ife_csid_hw/cam_ife_csid_hw_ver2.c b/drivers/cam_isp/isp_hw_mgr/isp_hw/ife_csid_hw/cam_ife_csid_hw_ver2.c index 4ee2cdfe88..0fff172590 100644 --- a/drivers/cam_isp/isp_hw_mgr/isp_hw/ife_csid_hw/cam_ife_csid_hw_ver2.c +++ b/drivers/cam_isp/isp_hw_mgr/isp_hw/ife_csid_hw/cam_ife_csid_hw_ver2.c @@ -1747,8 +1747,7 @@ static int cam_ife_csid_ver2_ipp_bottom_half( CAM_ERR(CAM_ISP, "Invalid params. evt_payload_priv: %s, handler_priv: %s", CAM_IS_NULL_TO_STR(evt_payload_priv), CAM_IS_NULL_TO_STR(handler_priv)); - rc = -EINVAL; - goto end; + return -EINVAL; } payload = evt_payload_priv; @@ -1853,8 +1852,7 @@ static int cam_ife_csid_ver2_ppp_bottom_half( CAM_ERR(CAM_ISP, "Invalid params. evt_payload_priv: %s, handler_priv: %s", CAM_IS_NULL_TO_STR(evt_payload_priv), CAM_IS_NULL_TO_STR(handler_priv)); - rc = -EINVAL; - goto end; + return -EINVAL; } payload = evt_payload_priv; @@ -1938,8 +1936,7 @@ static int cam_ife_csid_ver2_rdi_bottom_half( CAM_ERR(CAM_ISP, "Invalid params. evt_payload_priv: %s, handler_priv: %s", CAM_IS_NULL_TO_STR(evt_payload_priv), CAM_IS_NULL_TO_STR(handler_priv)); - rc = -EINVAL; - goto end; + return -EINVAL; } payload = evt_payload_priv;