Sunan Ibn Majah, Hadith 1477

It was narrated from Abu Hurairah that the Messenger of Allah said: ‘Hasten with the funeral (procession), for if the person was righteous then you are advancing him towards good, and if he was otherwise then it is evil which you are taking off of your necks.”

حَدَّثَنَا أَبُو بَكْرِ بْنُ أَبِي شَيْبَةَ، وَهِشَامُ بْنُ عَمَّارٍ، قَالاَ حَدَّثَنَا سُفْيَانُ بْنُ عُيَيْنَةَ، عَنِ الزُّهْرِيِّ، عَنْ سَعِيدِ بْنِ الْمُسَيَّبِ، عَنْ أَبِي هُرَيْرَةَ، قَالَ قَالَ رَسُولُ اللَّهِ ـ صلى الله عليه وسلم ـ ‏ "‏ أَسْرِعُوا بِالْجِنَازَةِ فَإِنْ تَكُنْ صَالِحَةً فَخَيْرٌ تُقَدِّمُونَهَا إِلَيْهِ وَإِنْ تَكُنْ غَيْرَ ذَلِكَ فَشَرٌّ تَضَعُونَهُ عَنْ رِقَابِكُمْ ‏" ‏ ‏.‏

sunnah.com