The Prophet Muhammad is considered free from errors (Ma'sum) by all Muslims.
In the sunni tradition you may find:
There is none amongst you with whom is not an attache from amongst the jinn (devil).
They (the Companions) said: Allah's Messenger, with you too?
Thereupon he said: Yes, but Allah helps me against him and so I am safe from his hand and he does not command me but for good. (Sahih Muslim and also in Musnad Ahmad)
A'isha the wife of Allah's Apostle (ﷺ), reported that one day Allah's Messenger (ﷺ) came out of her (apartment) during the night and she felt jealous. Then he came and he saw me (in what agitated state of mind) I was. He said:
A'isha, what has happened to you? Do you feel jealous? Thereupon she said: How can it be (that a woman like me) should not feel jealous in regard to a husband like you. Thereupon Allah's Messenger (ﷺ) said: It was your devil who had come to you, and she said: Allah's Messenger, is there along with me a devil? He said: Yes. I said: Is a devil attached to everyone? He said: Yes. I (Aisha) again said: Allah's Messenger, is it with you also? He said: Yes, but my Lord has helped me against him and as such I am absolutely safe from his mischief. (Sahih Muslim and also in Musnad Ahmad)
Anas b. Malik reported that Gabriel came to the Messenger of Allah (ﷺ) while he was playing with his playmates. He took hold of him and lay him prostrate on the ground and tore open his breast and took out the heart from it and then extracted a blood-clot out of it and said:
That was the part of Satan in thee. And then he washed it with the water of Zamzam in a golden basin and then it was joined together and restored to it place. The boys came running to his mother, i. e. his nurse, and said: Verily Muhammad has been murdered. They all rushed toward him (and found him all right) His color was changed, Anas said. I myself saw the marks of needle on his breast. (Sahih Muslim, Musnad Ahamd and sahih ibn Hebban)
“Do not enter upon Al-Mughibar (the women whose husband are absent), for indeed the Shaitan flows through one of you as the blood flows.” We said: “And you?” He said: “And me, but Allah helped me over him, so I am safe.” (Jami' at-Tirmdihi)
Most of the ahadith use the word "أَسْلَمَ" which may mean he submitted or he became a Muslim so the devil (Shaytan) which was attached to the Prophet () is considered as a Muslim.
Nevertherless it was also compilled with with the wording "أَسْلَمُ" -as in the verison Jami' at-Tirmidhi- which Sufyan ibn 'Uyaynah explained as follwos it means that Allah made the Prophet () safe from his Shyatan. He also added that Satan does never become a Muslim. Note that this is the opinion and wording of the hadith of ibn 'Uyayanah only -among the early scholars-.
This opinion was more or less adapted by ibn Taymiyah later who considered that anybody saying that Satan became a Muslim is wrong in contradiction to the majority of scholars.
Al-Qadi 'Iyad considered the first version more likely to be correct and so did scholars such ibn Hajar al-Hayathami, ibn al-Jawzi, as-Suytui, an-Nawawi etc..
So the answer is everybody has a Satan who is attached to him, even the Prophet () is/was not excluded, but Allah made him safe from his Satan.