Sunan Ibn Majah 252
سنن ابن ماجه#252SahihIt was narrated that Abu Hurairah said:"The Messenger of Allah said: 'Whoever acquires knowledge by which the pleasure of Allah is sought, but he only acquires it for the purpose of worldly gain, will not smell the fragrance of Paradise on the Day of Resurrection.'" (Hasan) Another chain with similar wording
Scholarly Authentication
We show the most cautious grade (weakest-wins) as the overall label. Individual scholars graded it as follows:
Al-AlbaniSahih
Muhammad Fouad Abd al-BaqiSahih
Shuaib Al ArnautHasan
Zubair Ali ZaiIsnaad Hasan