Why Goldman is worried about Bank of America

Bank Of America Building

Most U.S. banks came out of the recent stress tests looking pretty good, with one notable exception: Bank of America.

The second-largest bank in terms of deposits passed the test but left some analysts wondering just how strong its cash position is at least compared to its competitors.

Goldman Sachs expressed its concerns over BofA in a note Friday:

With the exception of BAC, all of the banks in our coverage universe appear well positioned to receive approval for their capital asks, assuming their requests are in-line with our estimates. For BAC, we believe the company may have to resubmit its capital request, although the math suggests this is very close.

(Read more: Bove bullish on banks after stress tests )

The question comes down to how much capital banks will be able to return to shareholders, a key to indicating bank health and the primary way to boost share value.

Overall, Goldman expects banks to have $90 billion of excess capital, about 45 percent of which it will return to shareholders in dividends and buybacks. Goldman projects BofA to have about $6.5 billion in excess capital against $6 billion to $7 billion in expected return-obviously a close shave for the company.

The longer look at how BofA fared was enough to rattle traders, who sent shares down about 0.6 percent in Friday morning trade while the rest of the sector fared better. The two institutions that Goldman said fared best in the tests-Capital One Financial and Citigroup-rose 2.8 percent and 0.75 percent, respectively, while the Financial Select SPDR (NYSE Arca: XLF) exchange-traded fund, which contains many of the tested companies, was up about 1 percent.

(Read more: Fed: 29 out of 30 banks meet stress test requirements )

It's certainly not to say that BofA is in more serious danger-its metrics in loan losses have improved considerably since the financial crisis, dropping from 10 percent in 2009 to 5.8 percent in 2014, and its capital ratios are in line as well.

In relative terms, though, Goldman said "we worry most" about the company compared to the rest of the group.

-By CNBC's Jeff Cox. Follow him on Twitter @JeffCoxCNBCcom .

Best place to workThe Best Firm of the Last Decade is...

Register for Financial Markets News Alerts