From: Thierry Herbelot Date: Mon, 24 May 2021 09:01:13 +0000 (+0200) Subject: test/crypto: fix mbuf reset after null check X-Git-Url: http://git.droids-corp.org/?a=commitdiff_plain;h=2b81eb2c992b2e3728b8866cf6199cfd3b5fd776;p=dpdk.git test/crypto: fix mbuf reset after null check Use m only after it was checked not to be NULL. Fixes: 202d375c60bc1 ("app/test: add cryptodev unit and performance tests") Cc: stable@dpdk.org Signed-off-by: Thierry Herbelot Acked-by: Akhil Goyal --- diff --git a/app/test/test_cryptodev.c b/app/test/test_cryptodev.c index ead8c6e3dc..dd1669e007 100644 --- a/app/test/test_cryptodev.c +++ b/app/test/test_cryptodev.c @@ -135,10 +135,11 @@ setup_test_string(struct rte_mempool *mpool, struct rte_mbuf *m = rte_pktmbuf_alloc(mpool); size_t t_len = len - (blocksize ? (len % blocksize) : 0); - memset(m->buf_addr, 0, m->buf_len); if (m) { - char *dst = rte_pktmbuf_append(m, t_len); + char *dst; + memset(m->buf_addr, 0, m->buf_len); + dst = rte_pktmbuf_append(m, t_len); if (!dst) { rte_pktmbuf_free(m); return NULL;