Sayyiduna Abdullah bin Mas'ud (may Allah be pleased with him) narrates this statement of the Noble Prophet (peace and blessings of Allah be upon him): "When a person has doubt regarding his prayer, he should try to estimate the correct situation, then say the salam, and then perform two prostrations of forgetfulness (sajda sahw)."
Hadith Referenceصحیح ابن حبان / كتاب الصلاة / 2659
Hadith Gradingفضيلة الشيخ الإمام محمد ناصر الدين الألبانيصحيح: ق - انظر (2646): ق. تنبيه!! رقم (2646) = (2656) من «طبعة المؤسسة». - مدخل بيانات الشاملة -.فضيلة الشيخ العلّامة شُعيب الأرناؤوطإسناده صحيح على شرط مسلم