This hadith is also narrated in the same way from Sa'id bin al-Musayyib and Abu Salamah bin 'Abd al-Rahman.
Imam Malik, may Allah have mercy on him, said that forgetfulness in prayer is of two types: one is that something is omitted from the prayer due to forgetfulness, in which case the prostration of forgetfulness (sajdah sahw) should be performed before the salam; the other is that something is added to the prayer due to forgetfulness, in which case the prostration of forgetfulness should be performed after the salam.