Sunan Ibn Majah, Volume 2, Book 6, Hadith 1477 (DarusSalam) ⓘ
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.”
حَدَّثَنَا أَبُو بَكْرِ بْنُ أَبِي شَيْبَةَ، وَهِشَامُ بْنُ عَمَّارٍ، قَالاَ حَدَّثَنَا سُفْيَانُ بْنُ عُيَيْنَةَ، عَنِ الزُّهْرِيِّ، عَنْ سَعِيدِ بْنِ الْمُسَيَّبِ، عَنْ أَبِي هُرَيْرَةَ، قَالَ قَالَ رَسُولُ اللَّهِ ـ صلى الله عليه وسلم ـ " أَسْرِعُوا بِالْجِنَازَةِ فَإِنْ تَكُنْ صَالِحَةً فَخَيْرٌ تُقَدِّمُونَهَا إِلَيْهِ وَإِنْ تَكُنْ غَيْرَ ذَلِكَ فَشَرٌّ تَضَعُونَهُ عَنْ رِقَابِكُمْ " .
also referenced under: Hadith 1477 (Reference) & Book 6, Hadith 1544 (In-Book)