Sayyiduna Abu Rafi' (may Allah be pleased with him) narrates: I heard the Prophet (peace and blessings be upon him) say: "When you name (a child) Muhammad, do not beat him and do not deprive him."
Al-Bazzar recorded it from his teacher Ghassan bin Ubayd, whom Ibn Hibban and others declared thiqah (trustworthy), and there is weakness in him.
Hadith Referenceمجمع الزوائد ومنبع الفوائد / كتاب الأدب / 12840