Legality of it (spoiler)

So given that the family adhered to these archaic traditions and this was supposedly in the 1920s, I’m assuming it must have been illegal for them to simply execute Meishan like that because of the illicit affair. Like a lynching of sorts, especially with the household trying to act like it didn’t happen and making it look like Songlian was “mad” afterwards, seemingly as a precaution in case word got out about what happened.

Still, was curious about it and wondered if anyone who is better acquainted with Chinese history knew more about the matter.

Did the master have this sort of power to simply off a mistress or a servant for breaking “rules?” What about if he simply wanted to on a whim? Could they be prosecuted for such a thing if it was found out, or would nothing happen, or at worst a tarnished name.

Also, could the doctor have intervened in any way, or stopped this from taking place if he wanted to/didn't care about his reputation? (I assume they must have either paid him off/threatened him to remain quiet and avoid a "scandal"). Or would he have gotten in more trouble for revealing the affair?

Just curious in terms of a historical hypothetical on how things stood back in those days.