It is narrated from Sayyiduna Ubayy bin Ka'b (may Allah be pleased with him) that the Messenger of Allah (peace and blessings be upon him) said: "Whoever offers the funeral prayer has one qirat (of reward), and whoever stays with the funeral until the deceased is buried has two qirats; and whoever has eaten from this vegetable (that is, garlic or onion) must not come near our mosque."
Imam al-Tabarani (may Allah have mercy on him) said: "No one narrated this hadith from al-Shaybani except Jarir."
Related hadith on this topic