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>
This commit is contained in:
Alexander Lobakin 2020-07-23 01:10:34 +03:00 committed by David S. Miller
parent a08c9b2c7c
commit 96ca4c50c7
1 changed files with 3 additions and 1 deletions

View File

@ -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