[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CABVgOSkuN7XPPvnBQFm_h80eFpx_fT0veDPxMefVbiNa_ZQG8g@mail.gmail.com>
Date: Sat, 2 Oct 2021 11:16:07 +0800
From: David Gow <davidgow@...gle.com>
To: Jeremy Kerr <jk@...econstruct.com.au>
Cc: Networking <netdev@...r.kernel.org>,
"David S. Miller" <davem@...emloft.net>,
Jakub Kicinski <kuba@...nel.org>,
Matt Johnston <matt@...econstruct.com.au>,
Brendan Higgins <brendanhiggins@...gle.com>,
"open list:KERNEL SELFTEST FRAMEWORK"
<linux-kselftest@...r.kernel.org>
Subject: Re: [PATCH net-next 2/2] mctp: test: defer mdev setup until we've registered
On Sat, Oct 2, 2021 at 10:27 AM Jeremy Kerr <jk@...econstruct.com.au> wrote:
>
> The MCTP device isn't available until we've registered the netdev, so
> defer storing our convenience pointer.
>
> Signed-off-by: Jeremy Kerr <jk@...econstruct.com.au>
> ---
Haha -- you sent this just as I'd come up with the same patch here. :-)
With these changes, alongside the rt->dev == NULL in
mctp_route_release() crash fix mentioned in [1], the tests all pass on
my system. (They also pass under KASAN, which bodes well.)
This fix is,
Reviewed-by: David Gow <davidgow@...gle.com>
Cheers,
-- David
[1]: https://lore.kernel.org/linux-kselftest/163309440949.24017.15314464452259318665.git-patchwork-notify@kernel.org/T/#m1a319b6932dd2bffaf78ab2d3b4c399282f7bda2
> net/mctp/test/utils.c | 10 +++++-----
> 1 file changed, 5 insertions(+), 5 deletions(-)
>
> diff --git a/net/mctp/test/utils.c b/net/mctp/test/utils.c
> index e2ab1f3da357..cc6b8803aa9d 100644
> --- a/net/mctp/test/utils.c
> +++ b/net/mctp/test/utils.c
> @@ -46,17 +46,17 @@ struct mctp_test_dev *mctp_test_create_dev(void)
> dev = netdev_priv(ndev);
> dev->ndev = ndev;
>
> - rcu_read_lock();
> - dev->mdev = __mctp_dev_get(ndev);
> - mctp_dev_hold(dev->mdev);
> - rcu_read_unlock();
> -
> rc = register_netdev(ndev);
> if (rc) {
> free_netdev(ndev);
> return NULL;
> }
>
> + rcu_read_lock();
> + dev->mdev = __mctp_dev_get(ndev);
> + mctp_dev_hold(dev->mdev);
> + rcu_read_unlock();
> +
> return dev;
> }
>
> --
> 2.30.2
>
Powered by blists - more mailing lists