My DS did this too for a month or two and probably stopped around 4-5 months old. I asked a child physio about it (whom we were seeing for other reasons) and she said that they often have an involuntary reflex that makes them do it and it is nothing to worry about and he will grow out of it. And he did.

HTH.