From Sahih Muslim (Hadith 2142):
Abdullah b. 'Umar reported that Hafsa wept for 'Umar (when he was about to die). He ('Umar) said:Be quiet, my daughter. Don't you know that the Messenger of Allah (ﷺ) had said:" The deceased is punished because of his family's weeping over the death"?
Reference: Muslim 2142