We asked our Prophet ﷺ about walking with the funeral procession. He said, "At a pace less than a brisk trot. If the deceased was righteous, then it is good to hasten him to his reward, and if he was otherwise, then may the people of the Fire be cast far away. The funeral bier is to be followed, not led. No one who walks ahead of it is truly with it."
حدثنا مسدد حدثنا أبو عوانة عن يحيى المجبر قال أبو داود وهو يحيى بن عبد الله التيمي عن أبي ماجدة
سألنا نبينا ﷺ عن المشي مع الجنازة فقال ما دون الخبب إن يكن خيرا تعجل إليه وإن يكن غير ذلك فبعدا لأهل النار والجنازة متبوعة ولا تتبع ليس معها من تقدمها
[Its chain is daif] Reported by Tirmidhi, chapter on funerals, section on what has been said about walking behind the funeral procession, no. 1011, from the hadith of Yahya al-Mujabbir with this wording, and he said, "Gharib." Ibn Majah also narrated it, no. 1484. Yahya bin Abdullah is lenient (lax) in transmission, and Abu Majidah is unknown.