net: hns3: add nic_client check when initialize roce base information
authorLipeng <lipeng321@huawei.com>
Tue, 24 Oct 2017 13:02:10 +0000 (21:02 +0800)
committerDavid S. Miller <davem@davemloft.net>
Thu, 26 Oct 2017 08:25:35 +0000 (17:25 +0900)
Roce driver works base on HNS3 driver.If insmod Roce driver before
NIC driver there is a error because do not check nic_client. This patch
adds nic_client check when initialize roce base information.

Fixes: 46a3df9 (net: hns3: Add HNS3 Acceleration Engine & Compatibility Layer Support)

Signed-off-by: Lipeng <lipeng321@huawei.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c

index 4431241..2c22d3c 100644 (file)
@@ -4285,7 +4285,7 @@ static int hclge_init_client_instance(struct hnae3_client *client,
                                vport->roce.client = client;
                        }
 
-                       if (hdev->roce_client) {
+                       if (hdev->roce_client && hdev->nic_client) {
                                ret = hclge_init_roce_base_info(vport);
                                if (ret)
                                        goto err;