An investigation by BaFin , the German financial regulator , has condemned the bank 's risk controls .