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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id C9667C7EE2F for ; Fri, 9 Jun 2023 07:47:10 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238987AbjFIHrI (ORCPT ); Fri, 9 Jun 2023 03:47:08 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54222 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239020AbjFIHqt (ORCPT ); Fri, 9 Jun 2023 03:46:49 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 45A771FDA for ; Fri, 9 Jun 2023 00:46:48 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id D02C8649A0 for ; Fri, 9 Jun 2023 07:46:47 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id D93C9C433D2; Fri, 9 Jun 2023 07:46:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1686296807; bh=NSWxYioClAEIWLHs3QT6KLt9d5O0l1WSA1+TYfnHoSE=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=xFFxAmHCkUp3Izh+n0YTae9jxgOb0rVmPydw22ywvIiJiCAl7ECv8xeRGDATW893X E9m5vkeRK7Pn07x2ajcnb/AvRI+Qgy5VrZO1fExTSRN+gyk6fy7CjJqaGxqpGqHKMg 3NHimKR/LznauHVuu0hWAAfZVts+6O+vJq8d5fdY= Date: Fri, 9 Jun 2023 09:46:44 +0200 From: Greg KH To: Dmitry Antipov Cc: Michael Jamet , linux-usb@vger.kernel.org, lvc-project@linuxtesting.org Subject: Re: [PATCH] thunderbolt: handle possible NULL pointer from get_device() Message-ID: <2023060903-unashamed-proactive-8bc9@gregkh> References: <20230609061619.57756-1-dmantipov@yandex.ru> <2023060911-expose-unplanned-964a@gregkh> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-usb@vger.kernel.org On Fri, Jun 09, 2023 at 10:15:36AM +0300, Dmitry Antipov wrote: > On 6/9/23 09:30, Greg KH wrote: > > > Sorry, but how can that happen? > > Hmmm.. there should be a complete mess in the device tree (e.g. passing > root device with no parent where the regular device is expected). If > you're sure that this doesn't worth checking then please disregard this. Again, how did you test this? And yes, the driver model guarantees that a child can never have a NULL parent (except for the root device, but that's a different story...) thanks, greg k-h