Ibn Abbas (may Allah be pleased with them both) narrated that the Prophet (peace and blessings be upon him) said: "Whoever sees in his commander something that he dislikes, let him be patient; and whoever separates from the community by a hand-span and dies in that state has died the death of jahiliyyah."
Hadith Referenceالسنن الكبرى للبيهقي / كتاب قتال أهل البغي / 16616