examples/l2fwd-crypto: fix possible out-of-bounds
authorPablo de Lara <pablo.de.lara.guarch@intel.com>
Mon, 31 Jul 2017 04:40:37 +0000 (05:40 +0100)
committerThomas Monjalon <thomas@monjalon.net>
Mon, 31 Jul 2017 20:46:36 +0000 (22:46 +0200)
commit8dbc9bbfe3d08d563abe7a65af7262af67214cf6
treed102490339a8338e0ef3d6338742284861b3a333
parent04716352beb06ec1285710dd9cb28316cadec57d
examples/l2fwd-crypto: fix possible out-of-bounds

rte_cryptodev_socket_id() returns the socket id of
a crypto device, unless the device id is not valid,
in which case, it returns -1.
This should not happen, as the device id is controlled
by the application, but just for safety, a check is added.

Coverity issue: 158628, 158638, 158656, 158662
Fixes: b3bbd9e5f265 ("cryptodev: support device independent sessions")

Signed-off-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
examples/l2fwd-crypto/main.c