It is narrated from Sayyiduna Anas (may Allah be pleased with him) that the Prophet (peace and blessings be upon him) said: "Whoever goes out in search of knowledge is in the path of Allah until he returns."
Imam al-Tabarani (may Allah have mercy on him) said: "This hadith is narrated from Sayyiduna Anas (may Allah be pleased with him) only with this chain, and Abu Ja'far (may Allah have mercy on him) and Khalid bin Yazid (may Allah have mercy on him) are alone in narrating it."