compress: Clear some simple scanbuild errors.
On Fedora30, GCC9+ reports errors: Issues report: vbdev_compress.c:482:17: warning: Assigned value is garbage or undefined comp_op->m_src = src_mbufs[0]; ^ ~~~~~~~~~~~~ vbdev_compress.c:502:17: warning: Assigned value is garbage or undefined comp_op->m_dst = dst_mbufs[0]; ^ ~~~~~~~~~~~~ vbdev_compress.c:491:3: warning: 1st function call argument is an uninitialized value rte_pktmbuf_attach_extbuf(dst_mbufs[iov_index], compress_ut.c:826:2: warning: Attempt to free released memory free(g_mbuf_mp); ^~~~~~~~~~~~~~~ Should remove free(g_mbuf_mp), for pointer exchange. Change-Id: I1a48b7c309a4e2aa0aa513f9be44ae3504d9e385 Signed-off-by: yidong0635 <dongx.yi@intel.com> Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/462574 Reviewed-by: Changpeng Liu <changpeng.liu@intel.com> Reviewed-by: Darek Stojaczyk <dariusz.stojaczyk@intel.com> Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
This commit is contained in:
parent
38889bbfd6
commit
a1de2fe007
@ -436,6 +436,11 @@ _compress_operation(struct spdk_reduce_backing_dev *backing_dev, struct iovec *s
|
|||||||
|
|
||||||
assert(src_iovcnt < MAX_MBUFS_PER_OP);
|
assert(src_iovcnt < MAX_MBUFS_PER_OP);
|
||||||
|
|
||||||
|
#ifdef DEBUG
|
||||||
|
memset(src_mbufs, 0, sizeof(src_mbufs));
|
||||||
|
memset(dst_mbufs, 0, sizeof(dst_mbufs));
|
||||||
|
#endif
|
||||||
|
|
||||||
comp_op = rte_comp_op_alloc(g_comp_op_mp);
|
comp_op = rte_comp_op_alloc(g_comp_op_mp);
|
||||||
if (!comp_op) {
|
if (!comp_op) {
|
||||||
SPDK_ERRLOG("trying to get a comp op!\n");
|
SPDK_ERRLOG("trying to get a comp op!\n");
|
||||||
|
@ -66,6 +66,7 @@ static void mock_rte_pktmbuf_attach_extbuf(struct rte_mbuf *m, void *buf_addr, r
|
|||||||
static void mock_rte_pktmbuf_attach_extbuf(struct rte_mbuf *m, void *buf_addr, rte_iova_t buf_iova,
|
static void mock_rte_pktmbuf_attach_extbuf(struct rte_mbuf *m, void *buf_addr, rte_iova_t buf_iova,
|
||||||
uint16_t buf_len, struct rte_mbuf_ext_shared_info *shinfo)
|
uint16_t buf_len, struct rte_mbuf_ext_shared_info *shinfo)
|
||||||
{
|
{
|
||||||
|
assert(m != NULL);
|
||||||
m->buf_addr = buf_addr;
|
m->buf_addr = buf_addr;
|
||||||
m->buf_iova = buf_iova;
|
m->buf_iova = buf_iova;
|
||||||
m->buf_len = buf_len;
|
m->buf_len = buf_len;
|
||||||
@ -823,7 +824,6 @@ test_initdrivers(void)
|
|||||||
free(dev_qp);
|
free(dev_qp);
|
||||||
}
|
}
|
||||||
|
|
||||||
free(g_mbuf_mp);
|
|
||||||
g_mbuf_mp = orig_mbuf_mp;
|
g_mbuf_mp = orig_mbuf_mp;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user