Merge "sdm: Check for valid fd and event before calling handlers"