Legal woes and profits mix as easily as oil and water.

Infineon Technologies (NYSE:IFX), the world's No. 6 chip maker, managed to turn a $132 million profit into a $69 million loss because it had to set aside $263 million for potential antitrust fines.

Underscoring the semiconductor industry's recovery from its worst recession ever, Infineon reported that revenues in its core memory chip business powered ahead 43% for the third quarter, while sales in its mobile memory segment were up 38%. Still, the legal woes weighed it down.

The U.S. Justice Department and the European Commission are both pursuing price-fixing investigations among DRAM suppliers, including Infineon, Micron Technology (NYSE:MU), Samsung Electronics, and Hynix Semiconductor, alleging that they kept chip prices artificially high during 2001 and 2002. Plaintiffs' attorneys, never ones to miss an opportunity to pile onto a bad situation, have filed some 25 class action lawsuits alleging violation of various state and federal antitrust and competition laws.

Spun off from German industrial titan Siemens (NYSE:SI) at the height of market exuberance in 1999, Infineon has been in the red just about ever since, reflecting the industry downdraft that hit soon after. It last posted a profit in 2000 and has since racked up losses of more than $3.7 billion. It has also had its share of insider turmoil. In March, Infineon reported that its CEO resigned after a dispute with German authorities over confiscatory taxes, threatening to move the company out of the country, though it now says it plans to stay put.

Despite the underlying improvements in profitability, the company has continued to be dogged by the antitrust charges, allegations that market researchers at Gartner Inc. find have little merit.

Because chip manufacturers need to keep their wafer fabrications operating even during bad times, DRAM still ends up in inventory even if it does not get sold. For example, Intel (NASDAQ:INTC) recently reported a good quarter but noted that inventories were up 15% on top of an 11% increase the prior quarter. Since a large inventory costs a company money, it has to work it down going forward. Gartner says that any widespread price-fixing scheme that could be agreed upon would collapse quickly as companies reduce costs by cutting prices.

Eighty percent of memory chips are sold in contracts with computer manufacturers, with the rest traded on the spot markets. It's on that residual amount the price fixing investigations are focused.

Infineon, along with other chip manufacturers, including Intel, Advanced Micro Devices (NYSE:AMD), and Rambus (NASDAQ:RMBS), have benefited from the industry's resurgence. Now it only remains to keep the lawyers out of the mix for shareholders to be able to realize their full profit potential.

Fool contributor Rich Duprey thinks tar, feathers, and lawyers would be a perfect mix. He does not own any of the stocks mentioned in this article.