summaryrefslogtreecommitdiffstats
path: root/drivers/net/ethernet
diff options
context:
space:
mode:
authorHuazhong Tan <tanhuazhong@huawei.com>2020-05-28 21:48:08 +0800
committerDavid S. Miller <davem@davemloft.net>2020-05-28 16:39:03 -0700
commit2421ee24777e9f7effc4b6db29276eced7ca2114 (patch)
tree98e4923550dce9c93347661e8d78f8bc818b6c81 /drivers/net/ethernet
parentf4b992b461b31910a0ef5acbad0af4906cbaaae0 (diff)
downloadlinux-2421ee24777e9f7effc4b6db29276eced7ca2114.tar.gz
linux-2421ee24777e9f7effc4b6db29276eced7ca2114.tar.bz2
linux-2421ee24777e9f7effc4b6db29276eced7ca2114.zip
net: hns3: remove an unnecessary 'goto' in hclge_init_ae_dev()
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>
Diffstat (limited to 'drivers/net/ethernet')
-rw-r--r--drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c
index 7c9f2ba1f272..0e36f037f69c 100644
--- a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c
+++ b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c
@@ -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;