The Prophet ﷺ said, "Whoever seeks knowledge, it will be an expiation for his past sins."
حدثنا محمد بن حميد الرازي حدثنا محمد بن المعلى حدثنا زياد بن خيثمة عن أبي داود عن عبد الله بن سخبرة
عن النبي ﷺ قال من طلب العلم كان كفارة لما مضى
No references are available.
[Its isnad is very daif] Darimi related it: 1/139, no. 567, from Muhammad bin Humayd through the same route. Abu Dawud is very daif and accused of fabrication, and Muhammad bin Humayd is daif.