The question isn’t whether interest rates will rise, but when. As Janet Yellen, the nominee to succeed Ben Bernanke as head of the Federal Reserve, made clear to lawmakers Thursday, the Fed won’t keep rates low forever.

Some investors already are trying to protect themselves by pouring money into “bank loan” funds, or portfolios that hold short-term loans extended by banks to companies.

A total of $54.31 billion flowed into such mutual funds in the first 10 months of this year, just $2 billion less than went into all U.S. stock mutual funds, according to research firm Morningstar.

One of the biggest: Interest rates on their holdings are locked in for short periods, typically three months or less. So the funds’ dividend yields, or income as a percentage of share value, should increase when interest rates rise. While the borrowers aren’t always top quality, loans are secured by their corporate assets.

But some “closed end” funds specializing in bank loans could surprise investors if interest rates start rising gradually. These funds come with a subtle complication that could limit their buoyancy just when investors are most eagerly expecting their yields to float up.

Closed-end funds generally issue a fixed number of shares. Instead of buying and selling them through the fund company, you must trade them on a stock exchange. So the shares sometimes sell at a “premium,” or more than the underlying assets are worth, and sometimes at a “discount,” or less than their value.

Closed ends tend to “leverage,” or borrow money, to amplify their income. Leverage enables most closed-end funds to pay out dividend yields of more than 6% on bank loans that pay interest rates around 5%. According to Morningstar, 26 such funds manage $11.94 billion in assets.

By holding these loans, investors are lending at a rate that will eventually rise as interest rates go up. But because the funds are leveraged, investors are also borrowing at a rate that will promptly rise if interest rates go up.

The funds’ assets and liabilities are tied to the London interbank offered rate, or Libor, a measure of the rates at which banks borrow.

More than 95% of new bank loans have “Libor floors” or minimum levels at which their income begins moving up if interest rates rise, says Robert Polenberg of S&P Capital IQ’s Leveraged Commentary & Data.

This week, Libor was at 0.24%. The rate on a loan with a typical 1% Libor floor won’t “float,” or move up, until Libor rises another 0.76%. Jeff Bakalar, co-head of senior loans at ING U.S. Investment Management, calls this the “waiting-by-the-mailbox syndrome.” Since rates often move a quarter-point at a time, it could take three increases before many floating-rate notes begin to float upward.

While the funds’ assets have a floor keeping yields from rising immediately, their liabilities don’t. The rate on the money the funds borrow will go up in lockstep with Libor.

“Investors need to understand the moving parts of how the income flows,” says Mariana Bush, a senior analyst at Wells Fargo Advisors. “If rates rise, the cost of borrowing will go up and the dividend yield is likely to go down, at least at first.” Any crimp will be temporary. As soon as Libor rises above 1%, yields should also float up.

But investors hate surprises. As high demand has reduced annual yields on bank loans to an average of 5.1% from 6.4% a year ago, several closed ends have cut their dividends. Partly as a result, the average such fund trades 4.4% below net asset value, down from a 5.4% premium in May.

Scott Page, director of the floating-rate loan group at Eaton Vance in Boston, estimates that a gradual rise in Libor could temporarily nick some closed-end yields by about 0.3 percentage point.

Scott Baskind, co-chief investment officer for bank loans at Invesco, and Dave Lamb, a senior vice president at Nuveen, say any reduction would likely be less than 0.2 point.

“The effect would be frictional at best,” says Leland Hart, a managing director at BlackRock. “My gut is that rates wouldn’t go up a little and stop; this would be part of a bigger [upward] move.” Rising yields on fund holdings, he says, should more than make up for higher borrowing costs.

Is a cut in income a negative? “Sure,” Mr. Page says. “Is it a reason to run screaming from the room? I don’t think so. But it should be in your expectation set as an investor.”

Watch these funds closely. Buy if their discounts widen to 10% or more, the traditional line marking bargain territory for closed ends. Otherwise, dozens of mutual funds specialize in bank loans; tell your financial adviser you’d rather stick to one of them instead.