The Messenger of Allah ﷺ passed by a grave and said, "Bring me two palm branches." He placed one at the head of the grave and the other at the feet.Someone asked, "Prophet of Allah, will this benefit him?"He replied, "Some of the punishment of the grave will be lightened for him as long as these two branches remain moist."
مر رسول الله ﷺ على قبر فقال: ائتوني بجريدتين فجعل إحداهما عند رأسه، والأخرى عند رجليه، فقيل: يا نبي الله! أينفعه ذلك؟ قال: لن يزال يخفف عنه بعض عذاب القبر ما كان فيهما ندو.
Ahmad (9686) narrated it from Muhammad bin Ubayd, from Yazid, meaning Ibn Kaysan, from Abu Hazim, from Abu Hurairah, and he mentioned it. Its isnad is hasan because of Yazid bin Kaysan, for there is disagreement about him, though his hadith is hasan.Bayhaqi narrated it in Ithbat Azab Qabr (136) through the route of Ibn Abu Shayba, who said, Muhammad bin Ubayd narrated to us, with his isnad. Haythami said in al-Majma (3/57), "Ahmad narrated it, and its narrators are the narrators of sahih." I say, it is as he said.This does not contradict what was mentioned earlier about the Prophet ﷺ passing by two graves, since the incident occurred more than once.As for what is reported from Abu Hurairah as a raised hadith, "The punishment of the grave comes from three things, backbiting, tale-carrying, and urine, so beware of that," the sound view is that it is a stopped report from the narration of Abu Aruba, from Qatada, as his own statement. Hafiz Bayhaqi said this in Ithbat Azab Qabr (262), and he said, "We have already related its meaning in the established hadiths mentioned previously."