The Messenger of Allah ﷺ said, "When a slave obeys his Lord and his master, he has two rewards."
حدثنا عفان حدثنا حماد قال أخبرنا عمار بن أبي عمار
أن رسول الله ﷺ قال إذا أطاع العبد ربه وسيده فله أجران
Its isnad is sahih. Bukhari narrated it with similar wording, 5/175, no. 2547, Fath, in the Book of Emancipation, chapter on the slave who performs the worship of his Lord well, and Muslim, 1/134, no. 154, in the Book of Faith, chapter on the obligation of believing in the message of our Prophet ﷺ.