A note on Codazzi tensors