Commit a1de2fe0 authored by yidong0635's avatar yidong0635 Committed by Darek Stojaczyk
Browse files

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: default avataryidong0635 <dongx.yi@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/462574


Reviewed-by: default avatarChangpeng Liu <changpeng.liu@intel.com>
Reviewed-by: default avatarDarek Stojaczyk <dariusz.stojaczyk@intel.com>
Tested-by: default avatarSPDK CI Jenkins <sys_sgci@intel.com>
parent 38889bbf
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -436,6 +436,11 @@ _compress_operation(struct spdk_reduce_backing_dev *backing_dev, struct iovec *s

	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);
	if (!comp_op) {
		SPDK_ERRLOG("trying to get a comp op!\n");
+1 −1
Original line number Diff line number Diff line
@@ -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,
		uint16_t buf_len, struct rte_mbuf_ext_shared_info *shinfo)
{
	assert(m != NULL);
	m->buf_addr = buf_addr;
	m->buf_iova = buf_iova;
	m->buf_len = buf_len;
@@ -823,7 +824,6 @@ test_initdrivers(void)
		free(dev_qp);
	}

	free(g_mbuf_mp);
	g_mbuf_mp = orig_mbuf_mp;
}