"Whoever follows the funeral of a Muslim man, seeking reward, and offers the prayer and buries him, will have two Qirats. And whoever offers the funeral prayer then goes back before the burial, then he returns with one Qirat of reward."
أَنَّ رَسُولَ اللَّهِ ﷺ قَالَ مَنْ تَبِعَ جَنَازَةَ رَجُلٍ مُسْلِمٍ احْتِسَابًا فَصَلَّى عَلَيْهَا وَدَفَنَهَا فَلَهُ قِيرَاطَانِ وَمَنْ صَلَّى عَلَيْهَا ثُمَّ رَجَعَ قَبْلَ أَنْ تُدْفَنَ فَإِنَّهُ يَرْجِعُ بِقِيرَاطٍ مِنَ الأَجْرِ