Mobile network gear maker Ericsson posted a second-quarter profit in line with expectations on Wednesday and said it was on track to meet its financial goals due to strong sales of 5G equipment.