It is narrated from Hazrat Abu Saeed Khudri (may Allah be pleased with him) that the Prophet (peace and blessings of Allah be upon him) said: Whoever performs a deed to show off, Allah will leave him to that deed, and whoever performs a deed to gain fame, Allah will leave him to that fame.
Hadith Referenceمسند احمد / مسند المكثرين من الصحابة / 11357
Hadith Gradingحکم دارالسلام:حديث صحيح، وهذا إسناد ضعيف لضعف عطية العوفي