Jami` at-Tirmidhi, Book 41, Hadith 4 (Tirmidhi 2718)

Narrated 'Abdullah bin Sakhbarah:

narrated that the Prophet (ﷺ) said: "Whoever seeks knowledge, he is atoning for what has passed (of sins while doing so)."