Is giving condolences to a professor socially acceptable? I'm an undergraduate in the US.

My professor just told us via email that he will not be able to grade an exam until next week because his family member died from complications due to COVID-19. I don't care much about the delay, but I do like my professor, both as a person and an educator. Would it be out of line for me to send an email along the lines of "Hi professor, I'm sorry to hear your loved one passed."

I'm not a very socially outgoing person and I don't speak up in class much, so I don't know if this would overstep the student-professor relationship.
It's not merely perfectly fine (e.g., in the U.S.), but a very good thing to do. (Conceivably in other cultures it could be construed as too intrusive, we must acknowledge.)