Yahya related to me from Malik from Ibn Shihab from Said ibn al-Musayyab that the Messenger of Allah, may Allah bless him and granthim peace, said, "Anyone who eats this plant should not come near ourmosques. The smell of the garlic will offend us."
App reference: Book 1, Hadith 30
USC-MSA web (English) reference: Book 1, Hadith 30
Arabic reference: Book 1, Hadith 31