Yahya related to me from Malik from Ibn Shihab from Said ibn al- Musayyab, and from Abu Salama ibn Abd ar-Rahman, the same as that. Malik said, "Every forgetfulness which decreases from the prayer, prostrations for it come before the greeting, and every forgetfulness which is an addition to the prayer, prostrations for it come after the greeting."
قَالَ مَالِكٌ كُلُّ سَهْوٍ كَانَ نُقْصَانًا مِنَ الصَّلاَةِ فَإِنَّ سُجُودَهُ قَبْلَ السَّلاَمِ وَكُلُّ سَهْوٍ كَانَ زِيَادَةً فِي الصَّلاَةِ فَإِنَّ سُجُودَهُ بَعْدَ السَّلاَمِ