mirror of
https://github.com/espressif/esp-idf.git
synced 2026-09-22 13:01:16 +03:00
CSI_FSM_INIT is 1, but the controller struct is zero-allocated. Any failure before the former csi_fsm assignment (near the end of esp_cam_new_csi_ctlr) jumped to err: which called s_del_csi_ctlr. That function bailed out immediately because csi_fsm == 0, leaking the claimed slot, queue, bridge, DMA channel, PM lock, and backup buffer. Move csi_fsm = CSI_FSM_INIT right after a successful claim so the err: path properly tears down all allocated resources.