Bug 1105977 - [FFOS2.0][Woodduck][SMS] The discard function is wrong

cherry-picked from 5e0a980ff72b83ee4fd23fa8066773d3471e88d4