The decision by Warren Buffett's Berkshire Hathaway (BRK.A -0.52%) (BRK.B -0.44%) to buy Taiwan Semiconductor Manufacturing (TSM 1.12%), better known as TSMC, and then sell most of that stock a short time later seemed to confuse most industry observers. Buffett and his company pride themselves on long-term investments, and given TSMC's lead in semiconductor manufacturing, it looked like what many would consider a "Buffett stock."

However, in a recent interview, Buffett said that his lieutenants bought the stock and that he decided to reverse most of that decision due to geopolitical concerns. Should Buffett's reasoning concern investors about the semiconductor industry? Let's take a closer look.

The problem with selling TSMC

TSMC looks like a Buffett stock, and its industry influence and essential nature make it one of the great foreign companies in which to invest. It claims nearly 60% of the world's third-party chip production, according to TrendForce. Additionally, since it produces most of its chips in Taiwan, it is the main reason why approximately two-thirds of worldwide chip production takes place on the island. It is the primary manufacturer for companies such as Qualcomm, Advanced Micro Devices, and Apple (AAPL -0.22%), Berkshire's largest holding.

Buffett holds valid concerns about Taiwan. China has claimed the island and threatened to invade it since before the semiconductor industry existed, and those threats have intensified in recent months. If that unlikely scenario came to pass, losing most of Taiwan's production capacity holds devastating consequences for fabless chip companies.

Nonetheless, the problem with Buffett's decision is that he and his team placed more than 40% of Berkshire's assets into Apple. Apple reportedly makes up over 25% of TSMC's business, so Apple and TSMC are essential to one another. Moreover, that means Berkshire already took on TSMC's geopolitical risk by owning Apple. If a Taiwan invasion is such a risk, why does Berkshire hold so much Apple stock?

TSMC and China

Buffett's assertion that a direct TSMC investment is dangerous but an indirect one is safe seems baffling. Admittedly, a Chinese invasion of Taiwan is possible, which is one of many reasons investors should diversify outside of the semiconductor industry.

Nonetheless, Berkshire's investment in Apple and its remaining TSMC stake are probably safe, since China also depends on the company's technology. Numerous products with TSMC's chips find their way to China, meaning the country would step back technologically if events were to sever China's ties to the company.

In the end, China can have Taiwan, or it can have products from TSMC's clients. However, it likely cannot have both, since TSMC's fabs would probably not survive a Taiwan invasion. It may also mean that the semiconductor industry may be saving Taiwan from an attack, a benefit to investors and society alike.

How investors should react

Ultimately, shareholders should react by staying on a course that matches their comfort levels. Investors who feel uncomfortable with geopolitical risk should avoid TSMC. But they should probably also avoid Apple and all fabless semiconductor stocks since they likely source most or all of their manufacturing from Taiwan.

Conversely, risk-tolerant investors should feel comfortable holding TSMC, Apple, or any other chip stock. They just need to remember to diversify outside of that industry. They should also never forget that positions in fabless chip companies almost always amount to indirect investments in TSMC. Such knowledge can protect shareholders if Buffett's worst fears about China and Taiwan become a reality.