Constraints on neutrino masses from leptogenesis models