The cam_sim structure was being deallocated unconditionally by device