It is narrated from Ibn Abbas (may Allah be pleased with them) that the Messenger of Allah (peace be upon him) passed by a woman who was in a litter. It was said to her: "This is the Messenger of Allah (peace be upon him)." She took hold of her child's arm and said: "Is his Hajj valid?" He (peace be upon him) said: "Yes, and the reward is for you."
Hadith Referenceمسند الإمام الشافعي / كتاب الحج / 938
Hadith Takhrijصحیح أخرجہ النسائی، مناسک، باب الحج بالصغیر (2650)۔