]> git.baikalelectronics.ru Git - kernel.git/commit
net: hns3: add return value for mailbox handling in PF
authorJian Shen <shenjian15@huawei.com>
Sun, 24 Apr 2022 12:57:25 +0000 (20:57 +0800)
committerDavid S. Miller <davem@davemloft.net>
Mon, 25 Apr 2022 09:48:49 +0000 (10:48 +0100)
commitb0947a1d131db7911d99b2b1e278346d76231c3d
treef41bd6fb3f1227b8c782bf26f42092d9e8986072
parent8cefbf22b37b004a354a2859904691eaed276dbd
net: hns3: add return value for mailbox handling in PF

Currently, there are some querying mailboxes sent from VF to PF,
and VF will wait the PF's handling result. For mailbox
HCLGE_MBX_GET_QID_IN_PF and HCLGE_MBX_GET_RSS_KEY, it may fail
when the input parameter is invalid, but the prototype of their
handler function is void. In this case, PF always return success
to VF, which may cause the VF get incorrect result.

Fixes it by adding return value for these function.

Fixes: b5d16b26a57f ("net: hns3: check queue id range before using")
Fixes: 00ebb4c8f736 ("net: hns3: add a check for index in hclge_get_rss_key()")
Signed-off-by: Jian Shen <shenjian15@huawei.com>
Signed-off-by: Guangbin Huang <huangguangbin2@huawei.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_mbx.c