Received: by 2002:a05:7412:37c9:b0:e2:908c:2ebd with SMTP id jz9csp598177rdb; Tue, 19 Sep 2023 05:08:32 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHXAZC+pbT2tu9pcd5ngQY4k0bIhHKx8ftZIhUgEQPGSdkqbhnTa29ILouEH1KVBoGd6ZZX X-Received: by 2002:a05:6a21:3e0b:b0:154:9943:732c with SMTP id bk11-20020a056a213e0b00b001549943732cmr10478898pzc.30.1695125312076; Tue, 19 Sep 2023 05:08:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1695125312; cv=none; d=google.com; s=arc-20160816; b=Ho+9IqCir4d4Zc/vgpzzq3B5AI68xtc9c7Ff3caPkGBzzPLcU6qF2L0nbFYJDpyhpJ JFCSgQ0wsClQQCUys3BXM1lmSnvETV2cjr02jwNJCies3g882zt9IGilp4eJ+BrOt2Ka n9+dmLgx9LWuKXf2ZNqw5Ibh4fze1IPdVETXbWCjHjKWHisSTfvHZhul8K58hjLTcUyw IyFNkOndL8/18IpuGsgVM5A8M57ts5WLyHZIl9nwJ7BqTjlmZlfg1Oq8tGGvCLjLCazm xsim29EE6EKsHJHluuGtRNfpaQ7IH4nqasavJD9Wb8MrhMmcDgWPe+7oAtIcLJxZWcXI yYyQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:mime-version:date :dkim-signature:message-id; bh=Z13/olEq8GyW2EUlZpY3hnsJroKO32II25IDBVJXOTs=; fh=dhMv9QVkO+XaudBi6HOW3NnnvDXwJw1+D1BDOQNlX2c=; b=VvCsAycxgIfc/mQnqa6M/33rca0x2iBn0yV0ZNnKBLewaN34q/6uTiKpnGCpY6hjZM MmAwNU81im9hlXg2oCuKcC/hXbl6S+W0BEeFSLSZs83UuQbvd/xq5z29RdG8o8Xk2WRN +638wiHxDPv14HzB6e7wkQJ/t5gWmLEN2AMNaB2qCbIw3A6R802I+uZuj3SsUlSGL74H 1LFDYDB0y0SV5d4rsZXkULS48XOkfqMKGlTd9P+hP8r4VrYdN15RiYCwQTEEDjIa03Lf FOuMFd65etFaD2y2uCZhLTelb+RGkM5ihBe9hVWmzRiBOwOId4oPaHqTd4bSalIkRsyp 53HA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linux.dev header.s=key1 header.b=ed9hcfrJ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linux.dev Return-Path: Received: from agentk.vger.email (agentk.vger.email. [23.128.96.32]) by mx.google.com with ESMTPS id bu7-20020a056a00410700b00690bdd81cadsi1474967pfb.155.2023.09.19.05.08.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 19 Sep 2023 05:08:32 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 as permitted sender) client-ip=23.128.96.32; Authentication-Results: mx.google.com; dkim=pass header.i=@linux.dev header.s=key1 header.b=ed9hcfrJ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linux.dev Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by agentk.vger.email (Postfix) with ESMTP id 8278980C4798; Tue, 19 Sep 2023 03:06:43 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at agentk.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230348AbjISKGn (ORCPT + 99 others); Tue, 19 Sep 2023 06:06:43 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33774 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229641AbjISKGm (ORCPT ); Tue, 19 Sep 2023 06:06:42 -0400 Received: from out-230.mta1.migadu.com (out-230.mta1.migadu.com [IPv6:2001:41d0:203:375::e6]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9290BE8 for ; Tue, 19 Sep 2023 03:06:36 -0700 (PDT) Message-ID: <8d8f2aee-ce64-166d-b13d-9791e8d47036@linux.dev> DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1695117994; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=Z13/olEq8GyW2EUlZpY3hnsJroKO32II25IDBVJXOTs=; b=ed9hcfrJ7JmwZfShPsWjCFY5zQAzN1IPjlyXGSNFlfp1CQGWD6e780HtKR64q1UBkPHSrE GM8q+2axy/e2IFaabfNVTkInuF8evswQ/LfkWwBoWmwPIbwP2n9Pf5cp6b91Tg2B1Zdoln V0GcDwmDpEh+2T9NIFLDq1XFRH3nxO4= Date: Tue, 19 Sep 2023 11:06:28 +0100 MIME-Version: 1.0 Subject: Re: [PATCH v2] net: hinic: Fix warning-hinic_set_vlan_fliter() warn: variable dereferenced before check 'hwdev' Content-Language: en-US To: Cai Huoqing Cc: Dan Carpenter , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , netdev@vger.kernel.org, linux-kernel@vger.kernel.org References: <20230919022715.6424-1-cai.huoqing@linux.dev> X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. From: Vadim Fedorenko In-Reply-To: <20230919022715.6424-1-cai.huoqing@linux.dev> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Migadu-Flow: FLOW_OUT X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on agentk.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (agentk.vger.email [0.0.0.0]); Tue, 19 Sep 2023 03:06:43 -0700 (PDT) On 19/09/2023 03:27, Cai Huoqing wrote: > 'hwdev' is checked too late and hwdev will not be NULL, so remove the check > > Fixes: 2acf960e3be6 ("net: hinic: Add support for configuration of rx-vlan-filter by ethtool") > Reported-by: Dan Carpenter > Closes: https://lore.kernel.org/r/202309112354.pikZCmyk-lkp@intel.com/ > Signed-off-by: Cai Huoqing > --- > v1->v2: Remove 'hwdev' check directly > v1 link: https://lore.kernel.org/lkml/20230918123401.6951-1-cai.huoqing@linux.dev/ > > drivers/net/ethernet/huawei/hinic/hinic_port.c | 3 --- > 1 file changed, 3 deletions(-) > > diff --git a/drivers/net/ethernet/huawei/hinic/hinic_port.c b/drivers/net/ethernet/huawei/hinic/hinic_port.c > index 9406237c461e..f81a43d2cdfc 100644 > --- a/drivers/net/ethernet/huawei/hinic/hinic_port.c > +++ b/drivers/net/ethernet/huawei/hinic/hinic_port.c > @@ -456,9 +456,6 @@ int hinic_set_vlan_fliter(struct hinic_dev *nic_dev, u32 en) > u16 out_size = sizeof(vlan_filter); > int err; > > - if (!hwdev) > - return -EINVAL; > - > vlan_filter.func_idx = HINIC_HWIF_FUNC_IDX(hwif); > vlan_filter.enable = en; > Reviewed-by: Vadim Fedorenko