Yahya related to me from Malik from Sumayy, the mawla of Abu
Bakr, that Abu Bakr ibn Abd ar-Rahman used to say, "Someone who goes
to the mosque in the morning or the afternoon with no intention of
going anywhere else, either to learn good or teach it, is like someone
who does jihad in the way of Allah and returns with booty."
Muwatta Malik Book 9, Hadith 61