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 takes part with the funeral until it is buried has two qirats; and whoever has eaten from this vegetable (garlic or onion) must not come near our mosque."
Sulayman (Imam al-Tabarani) (may Allah have mercy on him) said: "No one other than Jarir narrated this hadith from al-Shaybani."
Related hadith on this topic