The Quran has clear directive on the subject issue. When someone starts hurling insult at Prophet Mohammad, you do not hit the person. You do not create anarchy. You do not initiate riot. You simply avoid his discussion. It is God's system. God will take care of the person. Sadly, most of us do not know this fact.
[4:140] He has instructed you in the scripture that: if you hear GOD's revelations being mocked and ridiculed, you shall not sit with them, unless they delve into another subject. Otherwise, you will be as guilty as they are. GOD will gather the hypocrites and the disbelievers together in Hell.
[5:57] O you who believe, do not befriend those among the recipients of previous scripture who mock and ridicule your religion, nor shall you befriend the disbelievers. You shall reverence GOD, if you are really believers.
[6:68] If you see those who mock our revelations, you shall avoid them until they delve into another subject. If the devil causes you to forget, then, as soon as you remember, do not sit with such evil people.
[18:106] Their just requital is Hell, in return for their disbelief, and for mocking My revelations and My messengers.
[39:48] The sinful works they had earned will be shown to them, and the very things they used to mock will come back to haunt them.
[45:33] The evils of their works will become evident to them, and the very things they mocked will come back and haunt them.