summaryrefslogtreecommitdiff
path: root/drivers/net/ethernet/qlogic
diff options
context:
space:
mode:
authorAlexander Lobakin <alobakin@marvell.com>2020-07-23 01:10:34 +0300
committerDavid S. Miller <davem@davemloft.net>2020-07-22 18:19:03 -0700
commit96ca4c50c7f711531d4fa238906f8abbbd0ff517 (patch)
tree68b99966ced35c21e2a24afc21b224b9fdb6b7ae /drivers/net/ethernet/qlogic
parenta08c9b2c7ce52709f1915dae0bcd02070f39104e (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.c4
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