A remark on compact Ricci solitons