From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 6F56AC433EF for ; Sun, 3 Oct 2021 03:24:35 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 4FC5861352 for ; Sun, 3 Oct 2021 03:24:35 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229611AbhJCD0U (ORCPT ); Sat, 2 Oct 2021 23:26:20 -0400 Received: from pi.codeconstruct.com.au ([203.29.241.158]:34396 "EHLO codeconstruct.com.au" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229534AbhJCD0T (ORCPT ); Sat, 2 Oct 2021 23:26:19 -0400 Received: from pecola.lan (unknown [159.196.93.152]) by mail.codeconstruct.com.au (Postfix) with ESMTPSA id F202D20274; Sun, 3 Oct 2021 11:24:30 +0800 (AWST) Message-ID: Subject: Re: [PATCH net-next 2/2] mctp: test: defer mdev setup until we've registered From: Jeremy Kerr To: David Gow Cc: Networking , "David S. Miller" , Jakub Kicinski , Matt Johnston , Brendan Higgins , "open list:KERNEL SELFTEST FRAMEWORK" Date: Sun, 03 Oct 2021 11:24:30 +0800 In-Reply-To: References: <20211002022656.1681956-1-jk@codeconstruct.com.au> <20211002022656.1681956-2-jk@codeconstruct.com.au> Content-Type: text/plain; charset="UTF-8" User-Agent: Evolution 3.38.3-1 MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org Hi David, > 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.) Awesome, thanks for checking these out. I've since sent a v2 with the fixes integrated, in order to not break davem's build. I've refined the rt->dev == NULL case a little; rather than allowing ->dev == NULL in the core code (which should never happen), I've modified the test's route refcounting so that the route destroy path should only ever hit the test's own destructor instead (which allows !rt->dev cases). This means we can keep the ->dev != NULL assumption in the core, and still handle tests where our fake route->dev is unset. Cheers, Jeremy