[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20201026114633.1b2628ae@kicinski-fedora-PC1C0HJN.hsd1.ca.comcast.net>
Date: Mon, 26 Oct 2020 11:46:33 -0700
From: Jakub Kicinski <kuba@...nel.org>
To: Masahiro Fujiwara <fujiwara.masahiro@...il.com>
Cc: Pablo Neira Ayuso <pablo@...filter.org>,
Harald Welte <laforge@...monks.org>,
"David S. Miller" <davem@...emloft.net>,
Andreas Schultz <aschultz@...p.net>,
osmocom-net-gprs@...ts.osmocom.org, netdev@...r.kernel.org,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH v2 net] gtp: fix an use-before-init in gtp_newlink()
On Mon, 26 Oct 2020 16:22:27 +0900 Masahiro Fujiwara wrote:
> v2:
> - leave out_hashtable: label for clarity (Jakub).
> - fix code and comment styles.
Thanks!
> diff --git a/drivers/net/gtp.c b/drivers/net/gtp.c
> index 8e47d0112e5d..07cb6d9495e8 100644
> --- a/drivers/net/gtp.c
> +++ b/drivers/net/gtp.c
> @@ -663,10 +663,6 @@ static int gtp_newlink(struct net *src_net, struct net_device *dev,
>
> gtp = netdev_priv(dev);
>
> - err = gtp_encap_enable(gtp, data);
> - if (err < 0)
> - return err;
> -
> if (!data[IFLA_GTP_PDP_HASHSIZE]) {
> hashsize = 1024;
> } else {
> @@ -676,13 +672,17 @@ static int gtp_newlink(struct net *src_net, struct net_device *dev,
> }
>
> err = gtp_hashtable_new(gtp, hashsize);
> + if (err < 0)
> + return err;
> +
> + err = gtp_encap_enable(gtp, data);
> if (err < 0)
> goto out_encap;
This needs to say goto out_hashtable; now.
Powered by blists - more mailing lists