It is narrated from Hazrat Buraidah (may Allah be pleased with him) that the Noble Prophet (peace and blessings be upon him) said: I had previously forbidden you from visiting graveyards, now you may go, but do not say anything inappropriate.
Hadith Referenceمسند احمد / مسند الأنصار رضي الله عنهم / 23052
Hadith Gradingحکم دارالسلام:حديث صحيح، م: 977، وهذا إسناد ضعيف لضعف أبى جناب، لكنه توبع