From fa707abfd0ff291d3daf864d85f137d40f195292 Mon Sep 17 00:00:00 2001 From: Martin Date: Tue, 16 Jun 2020 11:18:58 +0530 Subject: [PATCH] bareudp: Fixed configuration to avoid having garbage values Code to initialize the conf structure while gathering the configuration of the device was missing. Fixes: ed095d08e6ed ("net: UDP tunnel encapsulation module for tunnelling different protocols like MPLS, IP, NSH etc.") Signed-off-by: Martin Signed-off-by: David S. Miller --- drivers/net/bareudp.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/net/bareudp.c b/drivers/net/bareudp.c index efd1a1d1f35e0..5d3c691a1c668 100644 --- a/drivers/net/bareudp.c +++ b/drivers/net/bareudp.c @@ -552,6 +552,8 @@ static int bareudp_validate(struct nlattr *tb[], struct nlattr *data[], static int bareudp2info(struct nlattr *data[], struct bareudp_conf *conf, struct netlink_ext_ack *extack) { + memset(conf, 0, sizeof(*conf)); + if (!data[IFLA_BAREUDP_PORT]) { NL_SET_ERR_MSG(extack, "port not specified"); return -EINVAL; -- 2.39.5