raw/skeleton: add missing check after setting attribute

This patch adds return value check for setting an attribute.

Fixes: 88a81bcecb7b ("raw/skeleton: remove compile-time constant for device id")
Cc: stable@dpdk.org

Signed-off-by: Min Hu (Connor) <humin29@huawei.com>
This commit is contained in:
Min Hu (Connor) 2021-04-22 14:21:46 +08:00 committed by Thomas Monjalon
parent 6beb2d2947
commit b97012825d

View File

@ -295,6 +295,7 @@ test_rawdev_attr_set_get(void)
dummy_value = &set_value;
*dummy_value = 200;
ret = rte_rawdev_set_attr(test_dev_id, "Test2", (uintptr_t)dummy_value);
RTE_TEST_ASSERT(!ret, "Unable to set an attribute (Test2)");
/* Check if attributes have been set */
ret = rte_rawdev_get_attr(test_dev_id, "Test1", &ret_value);