common/cpt: fix possible null dereference
authorKevin Traynor <ktraynor@redhat.com>
Wed, 6 Nov 2019 19:01:57 +0000 (19:01 +0000)
committerThomas Monjalon <thomas@monjalon.net>
Fri, 8 Nov 2019 15:40:13 +0000 (16:40 +0100)
commit01c65002b7153b4a111c77854715d535c0b6e851
tree427e2509bf5465292d9dc8f1524205626fefbc51
parente8b081e20db4aa78f9559ffca9dcefd41ef66e63
common/cpt: fix possible null dereference

Coverity complains that ctrl_flags is set to NULL at the start
of the function and it may not have been set before there is a
jump to fc_success and it is dereferenced.

Check for NULL before dereference.

312fc_success:
   CID 344983 (#1 of 1): Explicit null dereferenced
   (FORWARD_NULL)7. var_deref_op: Dereferencing null pointer ctrl_flags.
313        *ctrl_flags = rte_cpu_to_be_64(*ctrl_flags);

Coverity issue: 344983
Fixes: 6cc54096520d ("crypto/octeontx: add supported sessions")
Cc: stable@dpdk.org
Signed-off-by: Kevin Traynor <ktraynor@redhat.com>
Reviewed-by: David Marchand <david.marchand@redhat.com>
drivers/common/cpt/cpt_ucode.h