Again, ip_prev only gets set if there's an entry with an ->name before the match; and our one caller actually wants "the last entry with a name, or the last entry if none has a name, before the match".  It is a bit fiddlier than the case above, but surely can be done in a single pass through the list, instead of having to retraverse if we got a match but no previous.