Browse Source

msm: camera: cdm: Fixing memory leak in cdm driver

Free allocated memory in case of error scenario during
cdm interrupt handling.

CRs-Fixed: 3555034
Change-Id: Id0bcdd3a0ce4b78ffb13aa1655f886f808a8b4a0
Signed-off-by: Chandan Kumar Jha <[email protected]>
Chandan Jha 2 years ago
parent
commit
4252b1f555
1 changed files with 2 additions and 0 deletions
  1. 2 0
      drivers/cam_cdm/cam_cdm_hw_core.c

+ 2 - 0
drivers/cam_cdm/cam_cdm_hw_core.c

@@ -1349,6 +1349,8 @@ static void cam_hw_cdm_work(struct work_struct *work)
 				fifo_idx, payload->irq_data, core->arbitration);
 			mutex_unlock(&core->bl_fifo[fifo_idx].fifo_lock);
 			mutex_unlock(&cdm_hw->hw_mutex);
+			kfree(payload);
+			payload = NULL;
 			return;
 		}