]> git.proxmox.com Git - mirror_ubuntu-kernels.git/commitdiff
net: hns3: direct return when receive a unknown mailbox message
authorJian Shen <shenjian15@huawei.com>
Tue, 7 May 2024 13:42:19 +0000 (21:42 +0800)
committerPaolo Abeni <pabeni@redhat.com>
Thu, 9 May 2024 08:47:31 +0000 (10:47 +0200)
Currently, the driver didn't return when receive a unknown
mailbox message, and continue checking whether need to
generate a response. It's unnecessary and may be incorrect.

Fixes: bb5790b71bad ("net: hns3: refactor mailbox response scheme between PF and VF")
Signed-off-by: Jian Shen <shenjian15@huawei.com>
Signed-off-by: Jijie Shao <shaojijie@huawei.com>
Reviewed-by: Simon Horman <horms@kernel.org>
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_mbx.c

index d4a0e0be7a7230054d4e523ec463a16f52b9592e..59c863306657fa9315fe7d290387f73f3a818f16 100644 (file)
@@ -1077,12 +1077,13 @@ static void hclge_mbx_request_handling(struct hclge_mbx_ops_param *param)
 
        hdev = param->vport->back;
        cmd_func = hclge_mbx_ops_list[param->req->msg.code];
-       if (cmd_func)
-               ret = cmd_func(param);
-       else
+       if (!cmd_func) {
                dev_err(&hdev->pdev->dev,
                        "un-supported mailbox message, code = %u\n",
                        param->req->msg.code);
+               return;
+       }
+       ret = cmd_func(param);
 
        /* PF driver should not reply IMP */
        if (hnae3_get_bit(param->req->mbx_need_resp, HCLGE_MBX_NEED_RESP_B) &&