From c861a8d97aba8b7286413544723a6f5996f0bc66 Mon Sep 17 00:00:00 2001 From: Wyes Karny Date: Fri, 20 Nov 2020 19:24:05 +0530 Subject: [PATCH] msm: camera: isp: Fix for NULL dereference for failure case of dual IFE In the case of dual IFE acquire if left CSID reserve fails there is a possibility of NULL pointer dereference. CRs-Fixed: 2823225 Change-Id: Ib2bef582f69b245ee1d5b5b9ee8f5dacf8e2607a Signed-off-by: Wyes Karny --- drivers/cam_isp/isp_hw_mgr/cam_ife_hw_mgr.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 60e21abf0788..bff0a89cd560 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 @@ -1909,7 +1909,7 @@ acquire_successful: break; } - if (j == CAM_IFE_CSID_HW_NUM_MAX) { + if (j == -1 || !csid_acquire.node_res) { CAM_ERR(CAM_ISP, "Can not acquire ife csid dual resource"); goto end;