One who interrupted the words of Torah for idle talk — his remedy is to rise at midnight.
Sefer HaMidos, Torah Study, Part I §80