Skip to contentSkip to conversation

netfilter: fix the wrong alloc_size

PATCH In review Changli Gao 2 participants 2 messages Nov 14, 2010 – Nov 15, 2010

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 netfilter: fix the wrong alloc_size

In function update_alloc_size(), sizeof(struct nf_ct_ext) is added twice wrongly.

---
 net/netfilter/nf_conntrack_extend.c |    5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)
net/netfilter/nf_conntrack_extend.c +2 -3
index bd82450..920f924 100644
@@ -144,9 +144,8 @@ static void update_alloc_size(struct nf_ct_ext_type *type)
 		if (!t1)
 			continue;
 
-		t1->alloc_size = sizeof(struct nf_ct_ext)
-				 + ALIGN(sizeof(struct nf_ct_ext), t1->align)
-				 + t1->len;
+		t1->alloc_size = ALIGN(sizeof(struct nf_ct_ext), t1->align) +
+				 t1->len;
 		for (j = 0; j < NF_CT_EXT_NUM; j++) {
 			t2 = nf_ct_ext_types[j];
 			if (t2 == NULL || t2 == t1 ||
#1 lore raw
Quoted 2 lines · Changli Gao

In function update_alloc_size(), sizeof(struct nf_ct_ext) is added twice wrongly.

Nice catch, applied.