diff --git a/net/ipv4/netfilter/ip_nat_core.c b/net/ipv4/netfilter/ip_nat_core.c
index 16b071a..e86f537 100644
--- a/net/ipv4/netfilter/ip_nat_core.c
+++ b/net/ipv4/netfilter/ip_nat_core.c
@@ -518,28 +518,32 @@ ip_nat_reserved_unregister(struct ip_con
 }
 
 /* Unregister all reservations for a given expectation */
-void
-ip_nat_reserved_unregister_all(struct ip_conntrack_expect *expect)
+static inline void
+__ip_nat_reserved_unregister_all(struct ip_conntrack_expect *expect)
 {
-	struct list_head *i;
-	struct ip_nat_reserved *res;
+	struct ip_nat_reserved *res, *_res;
 
 	DEBUGP("ip_nat_reserved_unregister_all: deleting all reservations for expectation %p\n",
 			expect);
 
-	WRITE_LOCK(&ip_nat_lock);
-
-	i = expect->reserved_list.next;
-	while (i != &expect->reserved_list) {
-		res = list_entry(i, struct ip_nat_reserved, exp);
-		i = i->next;
-
+	list_for_each_entry_safe(res, _res, &expect->reserved_list, exp) {
 		/* clear from lists */
 		list_del(&res->hash);
 		list_del(&res->exp);
 
 		kmem_cache_free(ip_nat_reserved_cachep, res);
 	}
+}
+
+void
+ip_nat_reserved_unregister_all(struct ip_conntrack_expect *expect)
+{
+	if (list_empty(&expect->reserved_list))
+		return;
+
+	WRITE_LOCK(&ip_nat_lock);
+
+	__ip_nat_reserved_unregister_all(expect);
 
 	WRITE_UNLOCK(&ip_nat_lock);
 }
