Sunan an-Nasa'i, Book 44, Hadith 210 (In-Book)

It was narrated from Ibn 'Umar that: the Messenger of Allah forbade selling loyalty or giving it away. (Shah)

أَخْبَرَنَا قُتَيْبَةُ بْنُ سَعِيدٍ، قَالَ حَدَّثَنَا مَالِكٌ، عَنْ عَبْدِ اللَّهِ بْنِ دِينَارٍ، عَنِ ابْنِ عُمَرَ، أَنَّ رَسُولَ اللَّهِ صلى الله عليه وسلم نَهَى عَنْ بَيْعِ الْوَلاَءِ وَعَنْ هِبَتِهِ ‏.‏

sunnah.com