Эх сурвалжийг харах

Merge "msm: camera: icp: fix out of range for devcount" into camera-kernel.lnx.7.0

Camera Software Integration 1 жил өмнө
parent
commit
e383234b62

+ 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:
 hw_dev_deinit:
 	for (; i >= 0; i--) {
 	for (; i >= 0; i--) {
 		dev_info = &hw_mgr->dev_info[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--) {
 		for (; j >= 0; j--) {
 			dev_intf = dev_info->dev_intf[j];
 			dev_intf = dev_info->dev_intf[j];
 			dev_intf->hw_ops.deinit(dev_intf->hw_priv, NULL, 0);
 			dev_intf->hw_ops.deinit(dev_intf->hw_priv, NULL, 0);