Explorar el Código

msm: camera: icp: fix out of range for devcount

Fix loop range to hw_dev_cnt-1 to deal with out of range issue.

CRs-Fixed: 3660771
Change-Id: I5d8b76e44af04207ed4b68208474620fa9cb1b86
Signed-off-by: jinguiw <[email protected]>
(cherry picked from commit ead659d4bf783c37ff17af1bb4bc87edb4e64938)
jinguiw hace 1 año
padre
commit
efd58b1e1b
Se han modificado 1 ficheros con 1 adiciones y 1 borrados
  1. 1 1
      drivers/cam_icp/icp_hw/icp_hw_mgr/cam_icp_hw_mgr.c

+ 1 - 1
drivers/cam_icp/icp_hw/icp_hw_mgr/cam_icp_hw_mgr.c

@@ -4628,7 +4628,7 @@ static int cam_icp_mgr_device_init(struct cam_icp_hw_mgr *hw_mgr)
 hw_dev_deinit:
 	for (; i >= 0; i--) {
 		dev_info = &hw_mgr->dev_info[i];
-		j = (j == -1) ? dev_info->hw_dev_cnt : (j - 1);
+		j = (j == -1) ? (dev_info->hw_dev_cnt - 1) : (j - 1);
 		for (; j >= 0; j--) {
 			dev_intf = dev_info->dev_intf[j];
 			dev_intf->hw_ops.deinit(dev_intf->hw_priv, NULL, 0);