From: wangyunjian <wangyunjian@huawei.com>
To: intel-wired-lan@osuosl.org
Subject: [Intel-wired-lan] [PATCH net-next] ice: remove redundant null check on pf
Date: Wed, 27 Jan 2021 19:50:44 +0800 [thread overview]
Message-ID: <1611748244-20592-1-git-send-email-wangyunjian@huawei.com> (raw)
From: Yunjian Wang <wangyunjian@huawei.com>
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 <wangyunjian@huawei.com>
---
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);
--
2.23.0
next reply other threads:[~2021-01-27 11:50 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-01-27 11:50 wangyunjian [this message]
2021-01-27 23:37 ` [Intel-wired-lan] [PATCH net-next] ice: remove redundant null check on pf Nguyen, Anthony L
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1611748244-20592-1-git-send-email-wangyunjian@huawei.com \
--to=wangyunjian@huawei.com \
--cc=intel-wired-lan@osuosl.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox