[<prev] [next>] [day] [month] [year] [list]
Message-Id: <1636107586-3960637-1-git-send-email-jiasheng@iscas.ac.cn>
Date: Fri, 5 Nov 2021 10:19:46 +0000
From: Jiasheng Jiang <jiasheng@...as.ac.cn>
To: aelior@...vell.com, GR-everest-linux-l2@...vell.com,
davem@...emloft.net, kuba@...nel.org, ast@...nel.org,
daniel@...earbox.net, hawk@...nel.org, john.fastabend@...il.com
Cc: netdev@...r.kernel.org, linux-kernel@...r.kernel.org,
bpf@...r.kernel.org, Jiasheng Jiang <jiasheng@...as.ac.cn>
Subject: [PATCH] net: qed: Fix the use of NULL pointer
If the return value of 'IS_PF(cdev)' is False, then 'p_ptt'
is NULL and the check 'if (IS_PF(cdev) && !p_ptt)' can be
passed through.
Then 'p_ptt' will be used in qed_memcpy_to().
However, 'p_ptt' will be used there, such as 'p_ptt->idx'.
Thus it might be better to fix it.
Fixes: dacd88d ("qed: IOV l2 functionality")
Signed-off-by: Jiasheng Jiang <jiasheng@...as.ac.cn>
---
drivers/net/ethernet/qlogic/qed/qed_l2.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/net/ethernet/qlogic/qed/qed_l2.c b/drivers/net/ethernet/qlogic/qed/qed_l2.c
index dfaf10e..f5ada83 100644
--- a/drivers/net/ethernet/qlogic/qed/qed_l2.c
+++ b/drivers/net/ethernet/qlogic/qed/qed_l2.c
@@ -1932,7 +1932,7 @@ void qed_reset_vport_stats(struct qed_dev *cdev)
: NULL;
u32 addr = 0, len = 0;
- if (IS_PF(cdev) && !p_ptt) {
+ if (!p_ptt) {
DP_ERR(p_hwfn, "Failed to acquire ptt\n");
continue;
}
--
2.7.4
Powered by blists - more mailing lists