The revocation or cancellation of your visa does not revoke your status. Visa and status are two different things. Your status continues until the date stamped in your passport when you entered. After you enter the United States, the duration of your visa in the passport does not affect the duration of your authorized stay. Even if your visa expires, you can stay in the US as long as it is shown on your Form I-94 and stamped by CBP officer upon your entry. So, to answer your question, as long as you leave before the status expires, you will not be violating your status.
Now the issue you have is that, for some reason, the consulate is unhappy about your trip to the United States. Therefore, they are cancelling your tourist or visitor visa (B-1 / B-2). This usually happens when the consulate determines some negative or inconsistent information about you, your application, or your trip. For example, if during your visa interview or in your visa application you informed the consulate that you are planning to visit the US for a period of 2 weeks. Subsequently, after you enter the country, you spend several months here. If the consulate finds out, they will be upset and may decide to cancel your visa. Even if the consulate does not find out about the inconsistency in the intended length of your visit at this point, they will do so when you apply for a new visa and, in will probably deny your new visa at that time.
Therefore, it is important to provide truthful and detailed information to the consulate about your intended trip. It also goes without saying that you must truthfully answer all other questions in the visa application. The same issue comes up often when the applicants do not provide information about their relatives in the US. When the consulate finds out, they get furious and often cancel visas. Finally, please note that, often consulates keep a close watch after the first-time visitors. This means that, for example, the consulate issues a visa to the first-time applicant, and then observes that applicant’s behavior and actions in the US. They can even follow your social media profiles for any photographs or other evidence of inconsistency with the stated purpose of your visit.