It is narrated from Sayyiduna Ali (may Allah be pleased with him) that he sought permission from the Messenger of Allah (peace and blessings be upon him) that if a son were born to him after him (peace and blessings be upon him), could he name him with his (peace and blessings be upon him) name and give him his (peace and blessings be upon him) kunyah? He said: "So this was a concession from the Messenger of Allah (peace and blessings be upon him), and so his name was Muhammad and his kunyah was Abu al-Qasim."
And Imam Waki' (may Allah have mercy on him) narrated it from Fitr (may Allah have mercy on him).
Related hadith on this topic