diff options
author | Alexander Lobakin <alobakin@marvell.com> | 2020-07-23 01:10:34 +0300 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2020-07-22 18:19:03 -0700 |
commit | 96ca4c50c7f711531d4fa238906f8abbbd0ff517 (patch) | |
tree | 68b99966ced35c21e2a24afc21b224b9fdb6b7ae /drivers/net/ethernet/qlogic | |
parent | a08c9b2c7ce52709f1915dae0bcd02070f39104e (diff) |
qed: prevent possible double-frees of the chains
Zero-initialize chain on qed_chain_free(), so it couldn't be freed
twice and provoke undefined behaviour.
Signed-off-by: Alexander Lobakin <alobakin@marvell.com>
Signed-off-by: Igor Russkikh <irusskikh@marvell.com>
Signed-off-by: Michal Kalderon <michal.kalderon@marvell.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ethernet/qlogic')
-rw-r--r-- | drivers/net/ethernet/qlogic/qed/qed_chain.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/net/ethernet/qlogic/qed/qed_chain.c b/drivers/net/ethernet/qlogic/qed/qed_chain.c index bab02ff32514..917b783433f7 100644 --- a/drivers/net/ethernet/qlogic/qed/qed_chain.c +++ b/drivers/net/ethernet/qlogic/qed/qed_chain.c @@ -92,8 +92,10 @@ void qed_chain_free(struct qed_dev *cdev, struct qed_chain *chain) qed_chain_free_pbl(cdev, chain); break; default: - break; + return; } + + qed_chain_init_mem(chain, NULL, 0); } static int |