]> git.baikalelectronics.ru Git - kernel.git/commit
net: hns3: Fix for PF mailbox receving unknown message
authorXi Wang <wangxi11@huawei.com>
Fri, 25 May 2018 18:43:00 +0000 (19:43 +0100)
committerDavid S. Miller <davem@davemloft.net>
Tue, 29 May 2018 04:04:26 +0000 (00:04 -0400)
commite8f8fc8e310208d0246c0d575cc258ec36f546f4
tree98610bccea12ad1d6bd246503aa24e8f8ad474a5
parent3eb8a69877e72174e28b0f1f903647570bd45585
net: hns3: Fix for PF mailbox receving unknown message

Before the firmware updates the crq's tail pointer, if the PF driver
reads the data in the crq, the data may be incomplete at this time,
which will lead to the driver read an unknown message.

This patch fixes it by checking if crq is not empty before reading the
message.

Fixes: 85e2c7bfd9a9 ("net: hns3: Add mailbox interrupt handling to PF driver")
Signed-off-by: Xi Wang <wangxi11@huawei.com>
Signed-off-by: Peng Li <lipeng321@huawei.com>
Signed-off-by: Salil Mehta <salil.mehta@huawei.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_mbx.c