[PATCH] md: fix missing check on list iterator