The stock market managed to eke out some solid gains on Monday, but Wall Street wasn't able to sustain its upward momentum for a second day. Futures contracts were down slightly on Tuesday morning, with many investors waiting to see what the Federal Reserve's latest meeting minutes will reveal about its thought process on monetary policy. As of 8:45 a.m., futures on the Dow Jones Industrial Average (^DJI 0.56%) are down 26 points to 33,847. Futures on the S&P 500 (^GSPC -0.88%) have fallen 5 points to 4,294, and Nasdaq Composite (^IXIC -2.05%) futures have given up 11 points to land at 13,670.

Retail stocks are taking their turn with earnings this week, and the investing community has looked forward to seeing what Walmart (WMT 0.46%) would do after a tough showing last quarter. For the most part, Walmart's results satisfied shareholders. But one stock that Warren Buffett has made a substantial part of the holdings for the company he runs got even bigger gains. Below, you'll learn more about Walmart's numbers and then find out why Ally Financial (ALLY 0.88%) is outpacing even the retail giant's shares this morning.

Walmart gets back in gear

Shares of Walmart were up nearly 4% in premarket trading on Tuesday. The retailer's second-quarter financial report had good news for those who were concerned after poorer results three months ago.

Walmart's numbers held up better than some had feared. Revenue rose 8.4% to $152.9 billion. Comparable sales in the U.S. grew 6.5%, with a 12% rise in e-commerce activity. Some segments did even better, including the Sam's Club warehouse unit, where member counts reached an all-time high. International sales didn't rise as much, but much of the pressure there came from a strong U.S. dollar.

Walmart did see pressure on margins, with gross profit falling more than 1.3 percentage points. However, the company did a good job of holding expenses down, and that limited the damage to Walmart's bottom line. Adjusted earnings of $1.77 per share were better than what the company had predicted, albeit after it had cut its guidance from higher levels.

Walmart kept its outlook for the second half of the year unchanged, and CEO Doug McMillon pointed to its ongoing strategy to bulk up its digital distribution channel and expand into international markets as being helpful even under tough macroeconomic conditions. Walmart doesn't have the growth prospects of some smaller competitors, but it's doing its best to keep up the pace and maintain its leadership of the retail space.

Buffett has an Ally

Rising even further were shares of Ally Financial, which picked up nearly 7% in premarket trading. The banking institution got a boost from a bigger commitment from Warren Buffett.

Quarterly filings from Berkshire Hathaway (BRK.A 1.18%) (BRK.B 1.30%) indicated that the Buffett-led company increased its stake in Ally Financial substantially during the second quarter of 2022. By the end of June, Berkshire owned 30 million shares of the financial company, up from less than 9 million shares three months earlier.

Ally is relatively small, so even the big purchase from Buffett didn't cause the bank to crack the top half of the list of stocks that Berkshire holds. However, the stake amounts to more than 9% of Ally's stock, and given the regulatory challenges involved in going above the 10% mark, that indicates that Buffett will probably keep his position in Ally at around its current size.

The move from Buffett indicates newfound confidence in the banking industry generally. With exposure to high-growth areas like auto loans, insurance, and brokerage services, Ally has a diversified approach to financial services that could serve it well in the years ahead.