by Imam Malik, translation by A'isha `Abdarahman at-Tarjumana and Ya`qub Johnson , Volume: Prayer
Chapter: What to Do if One Stands After the Completion of the Prayer or After Two Rakas
Yahya related to me from Malik from Ibn Shihab from al-Araj that Abdullah ibn Buhayna said, "The Messenger of Allah, may Allah bless him and grant him peace, prayed two rakas with us and then stood without sitting and the people stood with him. When he had finished the prayerand we had seen him say the taslim, he said 'Allah is greater' and did two sajdas from the sitting position and then said the taslim again."
Yahya related to me from Malik from Yahya ibn Said from Abd ar-Rahman ibn Hurmuz that Abdullah ibn Buhayna said, "The Messengerof Allah, may Allah bless him and grant him peace, prayed dhuhr with us and he stood straight up after two rakas without sitting. When he had finished the prayer, he did two sajdas and then said the taslim after that."
Malik said, concerning someone who forgot in his prayer and stood up after he had completed four rakas and recited and then went into ruku and then, when he raised his head from ruku, remembered that he had already completed (his prayer), "He returns to a sitting position and does not do any sajda. If he has already done one sajda I do not think he should do the other. Then when his prayer is finished he does two sajdas from the sitting position after saying the taslim."