Hadithcore
Mishkat al-Masabih, 221

Sakhbara al-Azdi reported God’s messenger as saying, “If anyone seeks knowledge, it will be an atonement for past sins.” Tirmidhi and Darimi transmitted it, Tirmidhi saying that this is a tradition whose <i>isnad</i> is weak, and that Abu Dawud the transmitter is declared to be weak.

وَعَن سَخْبَرَة الْأَزْدِيّ قَالَ: قَالَ رَسُولُ اللَّهِ صَلَّى اللَّهُ عَلَيْهِ وَسَلَّمَ: «مِنْ طَلَبَ الْعِلْمَ كَانَ كَفَّارَةً لِمَا مَضَى» . رَوَاهُ التِّرْمِذِيُّ وَالدَّارِمِيُّ وَقَالَ التِّرْمِذِيُّ: هَذَا حَدِيثٌ ضَعِيفُ الْإِسْنَادِ وَأَبُو دَاوُدَ الرَّاوِي يُضَعَّفُ

References1 variant
In-Book Reference
Book 2, Hadith 23