I know you said that you don't have a problem with masturbation, but its sounds like this bothers you. If it does bother you, I agree with other posters that you should (very respectfully, without judgement) talk to him about it. But first you should figure out how you feel, what you would prefer to happen, and if your expectations are reasonable. Other posters have also pointed out that what he is doing is not wrong, that he is likely thinking of you, and/or not wanting to bother you and let you sleep. But asking him if that is what is behind it might help ease your mind. And, as several have said, maybe you could offer to help him out next time
