net/hns3: check multi-process action register result
authorWei Hu (Xavier) <xavier.huwei@huawei.com>
Sat, 4 Jul 2020 10:09:48 +0000 (18:09 +0800)
committerFerruh Yigit <ferruh.yigit@intel.com>
Tue, 7 Jul 2020 21:38:28 +0000 (23:38 +0200)
commit9570b1fdbdad47cab28dff58a017b0447bf32ed1
treede0f5356e436d157ac88f7bc47e7a8faffa85aa6
parent7569b8c19b1e72f0da493297d71cb7517420e408
net/hns3: check multi-process action register result

Currently, there is a coverity defect warning about hns3 PMD driver, the
detail information as blow:
CID 289969 (#1 of 1): Unchecked return value (CHECKED_RETURN)
1. check_return: Calling rte_mp_action_register without checking return
   value (as is done elsewhere 11 out of 13 times).

The problem is that missing checking the return value of calling the API
rte_mp_action_register during initialization. If registering an action
function for primary and secondary communication failed, the secondary
process can't work properly.

This patch fixes it by adding check return value of the API function
named rte_mp_action_register in the '.dev_init' implementation function
of hns3 PMD driver.

Coverity issue: 289969
Fixes: 23d4b61fee5d ("net/hns3: support multiple process")
Cc: stable@dpdk.org
Signed-off-by: Lijun Ou <oulijun@huawei.com>
Signed-off-by: Wei Hu (Xavier) <xavier.huwei@huawei.com>
drivers/net/hns3/hns3_ethdev.c
drivers/net/hns3/hns3_ethdev_vf.c
drivers/net/hns3/hns3_mp.c
drivers/net/hns3/hns3_mp.h