regex/mlx5: check DevX register write
authorMichael Baum <michaelba@nvidia.com>
Wed, 18 Nov 2020 17:00:08 +0000 (17:00 +0000)
committerThomas Monjalon <thomas@monjalon.net>
Sun, 22 Nov 2020 13:50:50 +0000 (14:50 +0100)
commitacb93dbcd0a766330d6f84340fb174ad2a97a943
treee87a98ecc3147eafd41ffeeca0eb3317315a1cf1
parent97de3671de4d067ce33ee5eeee9a87b450fb522c
regex/mlx5: check DevX register write

The rxp_flush_rules function tries to read and write to the register
several times using DevX API, and when it fails the function returns an
error.
Similarly the rxp_init_eng function also tries to write to the register
several times, and if writing is failed, it returns an error too.

Both functions have one write that the function does not check if it
succeeded, overriding the return value from the write function without
using it.

Add a check for this writing, and return an error in case of failure.

Fixes: b34d816363b5 ("regex/mlx5: support rules import")
Fixes: e3dbbf718ebc ("regex/mlx5: support configuration")
Cc: stable@dpdk.org
Signed-off-by: Michael Baum <michaelba@nvidia.com>
Acked-by: Ori Kam <orika@nvidia.com>
drivers/regex/mlx5/mlx5_rxp.c