A new data protection law is changing the calculus for doing business in China, with foreign and domestic firms scrambling to comply, and some companies including LinkedIn and Yahoo choosing to leave.

China’s personal information protection law, implemented this month, is the latest factor adding to a challenging political environment for businesses operating in the country and altering the cost-benefit analysis. While the untapped business potential of 1.4 billion consumers was once an irresistible draw, this is increasingly changing.

James Zimmerman, a Beijing-based American lawyer, said that the China market had become “less and less palatable for Western companies” because of “reputational risks of operating in an environment with extreme content censorship, and tighter regulatory conditions.”

The trade war brought politics into U.S.-China business to a much greater degree, with Beijing and Washington wielding tariffs and consumer product boycotts in their power struggle. Domestically, Beijing has launched a populist campaign against big business, effectively making the market less profitable for many companies under stricter new regulations.

And for some Western business executives, the human-rights controversies of President Xi Jinping’s era have become a bridge too far, including a crackdown on ethnic minorities in the Xinjiang region that Washington classified as genocide; silencing of Hong Kong protesters through use of force and imprisonment; and, most recently, the disappearance of tennis star Peng Shuai after she accused a former top official of sexual assault.

Women’s Tennis Association Chairman Steve Simon said last week the organization is willing to cease its China operations, potentially losing hundreds of millions of dollars, if Chinese authorities don’t properly investigate Peng’s allegations.

On Nov. 2, the same day the allegations appeared on Peng’s verified social media account, Yahoo announced it was pulling out of the China market due to “the increasingly challenging business and legal environment.” Days earlier, LinkedIn had also cited a significantly more challenging operating environment in its decision to close the Chinese version of its networking site, though it said it would keep a simple China job listing site without a social feed or the capability to share articles.

Yahoo had been downsizing its China operations for years, faced with diminishing business in the country because of censorship and competition from local players. In 2007, the company came under intense criticism in the United States for turning over emails of two Chinese political dissidents to Beijing authorities, which were used as evidence in their prosecution; they were later imprisoned. Yahoo shut down its email service in China in 2013 and closed its Beijing office in 2015.