Malik said: There is no harm if the one to whom something was advanced as a loan—whether gold, silver, food, or livestock—gives back to the lender something better than what was advanced, as long as that is not due to a condition between them or a customary practice. But if that is due to a condition, promise, or custom, then that is disliked and there is no good in it.
He said: That is because the Messenger of Allah, peace and blessings be upon him, "settled with a choice four-year-old camel in place of a young camel he had borrowed." And that Abdullah ibn Umar borrowed dirhams and repaid better than them. So if that is done out of the borrower’s goodwill, and it is not based on a condition, nor a promise, nor a custom, then it is permissible and there is no harm in it.
Malik narrated to me, from Humayd ibn Qays al-Makki, from Mujahid, that he said: "Abdullah ibn Umar borrowed some dirhams from a man, then repaid him with dirhams better than them. The man said: O Abu Abdur-Rahman, these are better than the dirhams I lent you. Abdullah ibn Umar said: 'I know, but my soul is content with that.'"
Hadith Referenceموطا امام مالك رواية يحييٰ / كتاب البيوع / 1387