Received: by 2002:a05:6358:7058:b0:131:369:b2a3 with SMTP id 24csp2187720rwp; Fri, 14 Jul 2023 02:05:53 -0700 (PDT) X-Google-Smtp-Source: APBJJlHV7ZCEUWcYpr9tTVdODgxBb7RvAF3WqdOliSjYLx7nSCsxCcUeGqYtPDz4esQrQJMojdFE X-Received: by 2002:a05:6a00:2386:b0:682:b6c8:2eb with SMTP id f6-20020a056a00238600b00682b6c802ebmr3604868pfc.1.1689325553005; Fri, 14 Jul 2023 02:05:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1689325552; cv=none; d=google.com; s=arc-20160816; b=C4ddc584xClEsJ4wwYyTOdPqN377FZrJSM7WTHue/vFme2PuVuBGZvLKeK1ddc+m+4 w+QXdVKj8TPj9BWXLgdRGb2//ZYFEY2cxzB2GVwjVtiiss/FUL9HYwmFioRyiUhdeh4R afEgMrtPpVkoS7qJLn6WKWH6epH/wXrRMMmREARU8/dqU/KRmyHTd9CNeO8sl0pLvpYp GORWgKEUCyxfc4b6NqnqcqyRJYaCz0zXN1OvvqqSkC3O5YBR1anY+q4dMrYvgOs/B2jx AT/arHZ8Rt7kiHtJXf7CCx8ANXXr/GVvP2duJkKi1xTkUQX0tRw4MNCKJq81ZcJgfQyJ AaBA== 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-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=wnvS+O3+nNdO+dMB7Q2wgfQ3QmY5Hlqgf9DPC1tLa1o=; fh=pZK7qSy/9zVlbAkQU8vXUAUTOZmMgib3AeXPYnkBgF4=; b=07DgLpGLrDQpiMjtkveOtgvjiJw2lu2qTH5hNPn5RWywpPsJZwezxGtWGDs8AEK77M nxCZ2KOzHKLzIO34wt/xQHjxNjTP3cvN9xuIYHAJvyptY/Wo2yaTCYQQxI2Cq7RcpWIs Fa/YXcJM3nG4PwNaRAo+izpTufxOitIVU3XAfkbaacr4cPrnAHsvOvJG2ufgTfDGYXnk W/n86VI2qbUgFTUxxN4H443YdMwWTnNvro9P9tCm95y0wpxugtC0hhxTZzTstDD3+ow7 H8Tpu/+MpQfCGfHK2a8GYS3Pszmliul1ZfyjEv5VWT8rLNpA0lQqE318L0xhKg8RjFD5 V8LQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@microchip.com header.s=mchp header.b=XOaYrlPd; 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 o16-20020a056a0015d000b0066891ffdfd5si6872505pfu.358.2023.07.14.02.05.41; Fri, 14 Jul 2023 02:05:52 -0700 (PDT) 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=XOaYrlPd; 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 S234938AbjGNISV (ORCPT + 99 others); Fri, 14 Jul 2023 04:18:21 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39114 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234493AbjGNISS (ORCPT ); Fri, 14 Jul 2023 04:18:18 -0400 Received: from esa.microchip.iphmx.com (esa.microchip.iphmx.com [68.232.154.123]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 420F31B6; Fri, 14 Jul 2023 01:18:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=microchip.com; i=@microchip.com; q=dns/txt; s=mchp; t=1689322696; x=1720858696; h=date:from:to:cc:subject:message-id:references: mime-version:in-reply-to; bh=O/X2f8LTxeBpseEWtQTCQinmCmN6v3Zs9Ep5/+MhYq4=; b=XOaYrlPdqV5d2WMhEualoMjFswG+FnXYxyagjXNlbqgU1TLzQwITpagf 2tUy4zVWo/sloWvMkYtarlLfF2wbKEO3g6HMFy7xQiB4PTILtLNZYobYL Poci9KiAd4kjwE1XYEd6G3YHm0mzVDXh1y8Mh/WIwJoLjE8X1V62D34iY QQjcHOd5omnZH41NqXygX0/YuOBgcnpMEt3+hsAWi48zi/D0qQ0cZD7Qx t3yKrsRdPtRhVFqXbCIvoH26n7EZf61j8Pdzb5mD4nUe7iWOuN2AZCzWu ztB9D/no4bU+/Jv3szHQucsY/i/vhioCua9MBM8GJ2c4K+T+yYiFaQfaF A==; X-IronPort-AV: E=Sophos;i="6.01,204,1684825200"; d="scan'208";a="161331392" X-Amp-Result: SKIPPED(no attachment in message) Received: from unknown (HELO email.microchip.com) ([170.129.1.10]) by esa6.microchip.iphmx.com with ESMTP/TLS/AES256-SHA256; 14 Jul 2023 01:18:15 -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.21; Fri, 14 Jul 2023 01:18:14 -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.21 via Frontend Transport; Fri, 14 Jul 2023 01:18:14 -0700 Date: Fri, 14 Jul 2023 10:18:14 +0200 From: Horatiu Vultur To: Minjie Du CC: , "maintainer:MICROCHIP LAN966X ETHERNET DRIVER" , "David S. Miller" , "Eric Dumazet" , Jakub Kicinski , Paolo Abeni , Richard Cochran , "open list:MICROCHIP LAN966X ETHERNET DRIVER" , open list , Subject: Re: [PATCH v2] net: lan966x: fix parameter check in two functions Message-ID: <20230714081814.3jltswaui6gbgkhc@soft-dev3-1> References: <20230714012220.891-1-duminjie@vivo.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Disposition: inline In-Reply-To: <20230714012220.891-1-duminjie@vivo.com> X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF, RCVD_IN_DNSWL_BLOCKED,RCVD_IN_MSPIKE_H5,RCVD_IN_MSPIKE_WL, SPF_HELO_PASS,SPF_NONE,T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED 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 07/14/2023 09:22, Minjie Du wrote: Hi Minjie, > > Make IS_ERR_OR_NULL() judge the vcap_get_rule() function return. > in lan966x_ptp_add_trap() and lan966x_ptp_del_trap(). > > Fixes: 72df3489fb10 ("net: lan966x: Add ptp trap rules") > Signed-off-by: Minjie Du You forgot to set the target tree in the subject. You can do that when you create the patch using the command: git format-patch ... --subject-prefix "PATCH net" ... Other than that, it looks OK: Reviewed-by: Horatiu Vultur > --- > drivers/net/ethernet/microchip/lan966x/lan966x_ptp.c | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > > diff --git a/drivers/net/ethernet/microchip/lan966x/lan966x_ptp.c b/drivers/net/ethernet/microchip/lan966x/lan966x_ptp.c > index 266a21a2d..59dd14247 100644 > --- a/drivers/net/ethernet/microchip/lan966x/lan966x_ptp.c > +++ b/drivers/net/ethernet/microchip/lan966x/lan966x_ptp.c > @@ -59,7 +59,7 @@ static int lan966x_ptp_add_trap(struct lan966x_port *port, > int err; > > vrule = vcap_get_rule(lan966x->vcap_ctrl, rule_id); > - if (vrule) { > + if (!IS_ERR_OR_NULL(vrule)) { > u32 value, mask; > > /* Just modify the ingress port mask and exit */ > @@ -106,7 +106,7 @@ static int lan966x_ptp_del_trap(struct lan966x_port *port, > int err; > > vrule = vcap_get_rule(lan966x->vcap_ctrl, rule_id); > - if (!vrule) > + if (IS_ERR_OR_NULL(vrule)) > return -EEXIST; > > vcap_rule_get_key_u32(vrule, VCAP_KF_IF_IGR_PORT_MASK, &value, &mask); > -- > 2.39.0 > > -- /Horatiu