From d1707245580b93bf4ba05dc7913ffbd176113f64 Mon Sep 17 00:00:00 2001 From: David Ahern Date: Wed, 19 Dec 2018 15:53:22 -0800 Subject: [PATCH] neighbor: Initialize protocol when new pneigh_entry are created pneigh_lookup uses kmalloc versus kzalloc when new entries are allocated. Given that the newly added protocol field needs to be initialized. Fixes: 488e8a298f11 ("neighbor: Add protocol attribute") Signed-off-by: David Ahern Signed-off-by: David S. Miller --- net/core/neighbour.c | 1 + 1 file changed, 1 insertion(+) diff --git a/net/core/neighbour.c b/net/core/neighbour.c index 43687c9abe1df..d9fa101b0e415 100644 --- a/net/core/neighbour.c +++ b/net/core/neighbour.c @@ -725,6 +725,7 @@ struct pneigh_entry * pneigh_lookup(struct neigh_table *tbl, if (!n) goto out; + n->protocol = 0; write_pnet(&n->net, net); memcpy(n->key, pkey, key_len); n->dev = dev; -- 2.39.5