net: hns3: remove an unnecessary 'goto' in hclge_init_ae_dev()
authorHuazhong Tan <tanhuazhong@huawei.com>
Thu, 28 May 2020 13:48:08 +0000 (21:48 +0800)
committerDavid S. Miller <davem@davemloft.net>
Thu, 28 May 2020 23:39:03 +0000 (16:39 -0700)
Remove the redundant 'goto' and return -ENOMEM directly, when
allocating memory for 'hdev' fails in hclge_init_ae_dev().

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

index 7c9f2ba..0e36f03 100644 (file)
@@ -9928,10 +9928,8 @@ static int hclge_init_ae_dev(struct hnae3_ae_dev *ae_dev)
        int ret;
 
        hdev = devm_kzalloc(&pdev->dev, sizeof(*hdev), GFP_KERNEL);
-       if (!hdev) {
-               ret = -ENOMEM;
-               goto out;
-       }
+       if (!hdev)
+               return -ENOMEM;
 
        hdev->pdev = pdev;
        hdev->ae_dev = ae_dev;