Bhagavad Gita 9.30

अपि चेत्सुदुराचारो भजते मामनन्यभाक्।साधुरेव स मन्तव्यः सम्यग्व्यवसितो हि सः ॥९.३०॥

api cetsudurācāro bhajate māmananyabhāksādhureva sa mantavyaḥ samyagvyavasito hi saḥ

Even if the most sinful worships Me, with devotion to no one else, he should indeed be regarded as righteous, for he has rightly resolved.

गीता