Received: by 2002:a05:6358:16cc:b0:ea:6187:17c9 with SMTP id r12csp2948929rwl; Fri, 6 Jan 2023 13:11:38 -0800 (PST) X-Google-Smtp-Source: AMrXdXvdHwler3jfa2Kg7LHyaYpIZOzXLLrJHqw+t/xXnVK/vijURW06aK2uPq6vBiLgZueJEfZQ X-Received: by 2002:a05:6a00:130d:b0:580:fb8e:3044 with SMTP id j13-20020a056a00130d00b00580fb8e3044mr53180977pfu.22.1673039498343; Fri, 06 Jan 2023 13:11:38 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1673039498; cv=none; d=google.com; s=arc-20160816; b=MUg595YhxRSeM3IAYHnEnFgAsEZRC60x2o2JxBeKEDZQdUOfYqOZNuImefsiUrwyeI Fj4px5dZspBaq6GocfbZYeYcSNmanbINtc+uuYjWef+LP5ApnWRLsBdzIaXvG8MxZx4/ QeW7eVJI3E+DAwkIqAqxuriEXRNPcpzFORwXnc8G3SYNUEz4LfN9J8Q6pT+gKLiMvA6w 7qqHJuhQmQwoq54Mj/PXtl7FZBLetqb6R+9dIRLfWqMANkfqcpDhq5jIDRXeBB/6hw+t z3LM94LAr1mLax+CJwFDedyWi99sgx5IUm6pm29NSeZBMjHVjhB0rpUj5lAV+fOcqNhb lcvA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-transfer-encoding :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=pbhKxmG5t/TM/czR8l4VScROqU5rMwVt8RSXN0f/J/E=; b=MVm17tbT/yNk7NVlNxpYuHL3mSJl0AfnRseljFaYwbmLz9lPR0A7D2ofbOUjjA5iyx LDexiaNdulWglLgco9P4LUZxC1DDB9obN12BrMdKEsNulCHYrCxO2uk0964S4kYk37Eo My9pNZEwi1jUWjChaC6Coju3IeAk6ZdfIJXN80yE2mK6YxYEAIMwiUfyAFeByKstFzSm mX9ink+WiPo1fJyqkdRr5XEH48Ieh4dLFyp4Hf38kaRkmIVeOaUtTOxIlaxaMewUmD2T 2NRMjAu9Txuz3H/YvvUsnDLRY3dA1WN5MCqKhvtJTM+kJ+YIsgxNVML8mNgn2xnYjmjJ 9ocQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@microchip.com header.s=mchp header.b=l37ts5+S; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=microchip.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id k126-20020a628484000000b00574d06d6a4fsi2206645pfd.56.2023.01.06.13.11.31; Fri, 06 Jan 2023 13:11:38 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@microchip.com header.s=mchp header.b=l37ts5+S; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=microchip.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236361AbjAFUTD (ORCPT + 55 others); Fri, 6 Jan 2023 15:19:03 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56616 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235773AbjAFUSK (ORCPT ); Fri, 6 Jan 2023 15:18:10 -0500 Received: from esa.microchip.iphmx.com (esa.microchip.iphmx.com [68.232.153.233]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8F81B7A38B; Fri, 6 Jan 2023 12:16:30 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=microchip.com; i=@microchip.com; q=dns/txt; s=mchp; t=1673036190; x=1704572190; h=date:from:to:cc:subject:message-id:references: mime-version:content-transfer-encoding:in-reply-to; bh=E59BVbXIk3cH9wxRO5cqBkZUsUNdLee72ymZRqWEtYo=; b=l37ts5+S7+V6zHoBbFD5BP3IM/5Zbln9aXAzHAbj5O3Jj1ACoJqveUw6 d3ktlGnrw+uyqpB7V6FZYyBSZ/XaxsfTUInWucA0vBlMkiAlzqbpanjcr 8uwLI1SU2OWyapMofXsnGehorKDHRlNEMBP/kESAPPJ7oYtime68lyUE8 9CW7sEpYOOt9RWKybaGlGOFDbRIYrZWlg2HKAYUpNo0mWikeo96P2UQoi CsjGRhzBU9/tYcRfqa+gCquj1l/S9kBZhHaI/+YoAkEydCiS7Ofo8wX2W pP0O7MnLxXV/9ZrjpgL/x9opqnEV5hAzLb1YOU3fKE5gHDyLXNL0CI9cq A==; X-IronPort-AV: E=Sophos;i="5.96,306,1665471600"; d="scan'208";a="195636436" Received: from unknown (HELO email.microchip.com) ([170.129.1.10]) by esa3.microchip.iphmx.com with ESMTP/TLS/AES256-SHA256; 06 Jan 2023 13:16:29 -0700 Received: from chn-vm-ex02.mchp-main.com (10.10.85.144) by chn-vm-ex04.mchp-main.com (10.10.85.152) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.16; Fri, 6 Jan 2023 13:16:29 -0700 Received: from localhost (10.10.115.15) by chn-vm-ex02.mchp-main.com (10.10.85.144) with Microsoft SMTP Server id 15.1.2507.16 via Frontend Transport; Fri, 6 Jan 2023 13:16:29 -0700 Date: Fri, 6 Jan 2023 21:21:48 +0100 From: Horatiu Vultur To: =?utf-8?B?Q2zDqW1lbnQgTMOpZ2Vy?= CC: , "David S. Miller" , Eric Dumazet , Jakub Kicinski , "Paolo Abeni" , Richard Cochran , , Subject: Re: [PATCH] net: lan966x: check for ptp to be enabled in lan966x_ptp_deinit() Message-ID: <20230106202148.77gkauaikjhyjcvi@soft-dev3-1> References: <20230106134830.333494-1-clement.leger@bootlin.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20230106134830.333494-1-clement.leger@bootlin.com> X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED, RCVD_IN_MSPIKE_H2,SPF_HELO_PASS,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The 01/06/2023 14:48, Clément Léger wrote: Hi Clement, > > If ptp was not enabled due to missing IRQ for instance, > lan966x_ptp_deinit() will dereference NULL pointers. > > Fixes: d096459494a8 ("net: lan966x: Add support for ptp clocks") > Signed-off-by: Clément Léger You forgot to mark the patch to target the net tree. But other than that looks good. Reviewed-by: Horatiu Vultur > --- > drivers/net/ethernet/microchip/lan966x/lan966x_ptp.c | 3 +++ > 1 file changed, 3 insertions(+) > > diff --git a/drivers/net/ethernet/microchip/lan966x/lan966x_ptp.c b/drivers/net/ethernet/microchip/lan966x/lan966x_ptp.c > index f9ebfaafbebc..a8348437dd87 100644 > --- a/drivers/net/ethernet/microchip/lan966x/lan966x_ptp.c > +++ b/drivers/net/ethernet/microchip/lan966x/lan966x_ptp.c > @@ -1073,6 +1073,9 @@ void lan966x_ptp_deinit(struct lan966x *lan966x) > struct lan966x_port *port; > int i; > > + if (!lan966x->ptp) > + return; > + > for (i = 0; i < lan966x->num_phys_ports; i++) { > port = lan966x->ports[i]; > if (!port) > -- > 2.38.1 > -- /Horatiu