The works of Ādi Śaṅkarācārya

Viṣṇusahasranāmastotram

Verse 220

गुरोर्यत्र परीवादो निन्दा वापि प्रवर्तते ।कर्णौ तत्र पिधातव्यौ गन्तव्यं वा ततोऽन्यतः ॥

In plain words

Wherever your teacher is being slandered, or even merely faulted — cover your ears there, or get up and go somewhere else.

Close to the Sanskrit

Where slander of the guru, or even fault-finding, is going on — there the two ears are to be covered, or one should go from there elsewhere.