[dpdk-dev] [PATCH] test/compress: fix coverity warnings

Trahe, Fiona fiona.trahe at intel.com
Fri Jul 26 10:37:52 CEST 2019


Hi Adam,

> -----Original Message-----
> From: Dybkowski, AdamX
> Sent: Thursday, July 25, 2019 3:23 PM
> To: Trahe, Fiona <fiona.trahe at intel.com>; dev at dpdk.org; akhil.goyal at nxp.com
> Subject: RE: [PATCH] test/compress: fix coverity warnings
> 
> Hi Fiona.
> 
> > -----Original Message-----
> > From: Trahe, Fiona
> > Sent: Thursday, 25 July, 2019 15:56
> > To: Dybkowski, AdamX <adamx.dybkowski at intel.com>; dev at dpdk.org;
> > akhil.goyal at nxp.com
> > Cc: Trahe, Fiona <fiona.trahe at intel.com>
> > Subject: RE: [PATCH] test/compress: fix coverity warnings
> >
> > Hi Adam,
> >
> > > -----Original Message-----
> > > From: Dybkowski, AdamX
> > > Sent: Tuesday, July 23, 2019 11:54 AM
> > > To: dev at dpdk.org; Trahe, Fiona <fiona.trahe at intel.com>;
> > > akhil.goyal at nxp.com
> > > Cc: Dybkowski, AdamX <adamx.dybkowski at intel.com>
> > > Subject: [PATCH] test/compress: fix coverity warnings
> > >
> > > CID 340857: Null pointer dereferences (NULL_RETURNS)
> > >
> > > CID 340856: (CONSTANT_EXPRESSION_RESULT)
> > >
> > > Fixes: 3be12ea52ad8 ("test/compress: improve debug trace setup")
> > >
> > > Signed-off-by: Adam Dybkowski <adamx.dybkowski at intel.com>
> > > ---
> > >  app/test/test_compressdev.c | 10 ++++++++--
> > >  1 file changed, 8 insertions(+), 2 deletions(-)
> > >
> > > diff --git a/app/test/test_compressdev.c b/app/test/test_compressdev.c
> > > index 65889c242..992eac8e0 100644
> > > --- a/app/test/test_compressdev.c
> > > +++ b/app/test/test_compressdev.c
> > > @@ -755,6 +755,12 @@ test_deflate_comp_decomp(const struct
> > interim_data_params *int_data,
> > >  	char *contig_buf = NULL;
> > >  	uint64_t compress_checksum[num_bufs];
> > >
> > > +	if (capa == NULL) {
> > > +		RTE_LOG(ERR, USER1,
> > > +			"Compress device does not support DEFLATE\n");
> > > +		return -1;
> > [Fiona] shouldn't you return -ENOTSUP?
> [Adam] All other errors end with returning -1 (see the ret_status variable which is initialized to -1).
> That's why I handle the error case the same way. This is inside the test suite, not a PMD.
[Fiona] ok, can see in the code that the capability is already checked at the higher level
for this case, so no need to return ENOTSUP here. -1 is ok
Acked-by: Fiona Trahe <fiona.trahe at intel.com>



More information about the dev mailing list