From patchwork Wed Jan 27 11:50:44 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: wangyunjian X-Patchwork-Id: 12049825 X-Patchwork-Delegate: kuba@kernel.org Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.7 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 67EAEC433E6 for ; Wed, 27 Jan 2021 11:53:25 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 0D6802076B for ; Wed, 27 Jan 2021 11:53:24 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237419AbhA0LxR (ORCPT ); Wed, 27 Jan 2021 06:53:17 -0500 Received: from szxga04-in.huawei.com ([45.249.212.190]:11203 "EHLO szxga04-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237209AbhA0Lvk (ORCPT ); Wed, 27 Jan 2021 06:51:40 -0500 Received: from DGGEMS407-HUB.china.huawei.com (unknown [172.30.72.60]) by szxga04-in.huawei.com (SkyGuard) with ESMTP id 4DQhj13GF9zl9Dw; Wed, 27 Jan 2021 19:49:25 +0800 (CST) Received: from localhost (10.174.242.175) by DGGEMS407-HUB.china.huawei.com (10.3.19.207) with Microsoft SMTP Server id 14.3.498.0; Wed, 27 Jan 2021 19:50:46 +0800 From: wangyunjian To: , CC: , , , , Yunjian Wang Subject: [PATCH net-next] ice: remove redundant null check on pf Date: Wed, 27 Jan 2021 19:50:44 +0800 Message-ID: <1611748244-20592-1-git-send-email-wangyunjian@huawei.com> X-Mailer: git-send-email 1.9.5.msysgit.1 MIME-Version: 1.0 X-Originating-IP: [10.174.242.175] X-CFilter-Loop: Reflected Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org X-Patchwork-Delegate: kuba@kernel.org From: Yunjian Wang Before calling ice_set_dflt_mib(), the 'pf' has been dereferenced. So the additional check is unnecessary, just remove it. Addresses-Coverity: ("Dereference before null check") Fixes: 7d9c9b791f9e ("ice: Implement LFC workaround") Signed-off-by: Yunjian Wang --- drivers/net/ethernet/intel/ice/ice_main.c | 5 ----- 1 file changed, 5 deletions(-) diff --git a/drivers/net/ethernet/intel/ice/ice_main.c b/drivers/net/ethernet/intel/ice/ice_main.c index 6e251dfffc91..43117cb4ef18 100644 --- a/drivers/net/ethernet/intel/ice/ice_main.c +++ b/drivers/net/ethernet/intel/ice/ice_main.c @@ -788,11 +788,6 @@ static void ice_set_dflt_mib(struct ice_pf *pf) struct ice_hw *hw; u32 ouisubtype; - if (!pf) { - dev_dbg(dev, "%s NULL pf pointer\n", __func__); - return; - } - hw = &pf->hw; mib_type = SET_LOCAL_MIB_TYPE_LOCAL_MIB; lldpmib = kzalloc(ICE_LLDPDU_SIZE, GFP_KERNEL);