Received: by 2002:a25:ef43:0:0:0:0:0 with SMTP id w3csp446476ybm; Thu, 28 May 2020 06:56:17 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzM76oB6mkOdQ9B7Ptr5F9Loe1jMQy0t7ifREnvuZE1cPkdX9hQyaij+GAPTBzQlccmPgX8 X-Received: by 2002:a50:ec0d:: with SMTP id g13mr3234287edr.296.1590674177495; Thu, 28 May 2020 06:56:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1590674177; cv=none; d=google.com; s=arc-20160816; b=nUTo+4kLrxx0fmarp8zI2xrO6Vm3qnY9KkTvsQCosf+vpaucNTx2aOaAMmqjo/tN1G wsGkYnBYEfxZDS7cBhE8l6bipXf5dBwl0NM6yc0Q+jd4FABDXGu/uU/zfdbTHiv1/atd za39GYUjRIqLo8NEZak6LBfTH+N7OKu+5VgzHrRN7c/b2Tmp09lY2m63jRfk2ou4ENG9 tbKC8Ply3rmMkPVLbwBishyMt2bSgtRv0x35pB8ujr4wpDd4Aod+xxbqtVSMhUM6byT5 JW0knJzX1/SzjG08XHk76lQzs9gWmZtrmIrJl1gZYoqDOlNiwA6DReEkEi0Yrt2Y6JQM c0mQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from; bh=pmgwJayjcpznYPEEH7shEziXJXt+Lwe4F0e2XTx+QX0=; b=cTWWCHDBMMuFpIYkB0YynvqCLMT3FuY8mjahJMo3ibPkuAkkb6fwRCQcWjNfsMHgWQ dOCZaLkPU2U4l3XTcmqbFrBcoKXVAU4jfEKP+5jHRq5TZYJUlwqianeSDLNwIfZQV832 zCBvYgM+qZyFVJKdbRY5HbF1/sb9uTApEqRIQCPftamJfbLjEcY+0G8H/+qM1NXCYRBk yV/TDJQavqn/7MpwmSNouT+cGtTkEuVnfeRDdoWXDBljClM8QMx8wMDrvlS3xUdh21Os TJf79eJ+4dt1KQbCwXdL4P0XNoji78va4iJnquKGJL8dGH1YcFh+eGK/zGN8P9Lr6fcT vZyA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id di26si3615517edb.242.2020.05.28.06.55.54; Thu, 28 May 2020 06:56:17 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2390786AbgE1NxB (ORCPT + 99 others); Thu, 28 May 2020 09:53:01 -0400 Received: from szxga04-in.huawei.com ([45.249.212.190]:5383 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S2390609AbgE1NvE (ORCPT ); Thu, 28 May 2020 09:51:04 -0400 Received: from DGGEMS413-HUB.china.huawei.com (unknown [172.30.72.58]) by Forcepoint Email with ESMTP id 5B041FE075497678788E; Thu, 28 May 2020 21:50:59 +0800 (CST) Received: from localhost.localdomain (10.69.192.56) by DGGEMS413-HUB.china.huawei.com (10.3.19.213) with Microsoft SMTP Server id 14.3.487.0; Thu, 28 May 2020 21:50:48 +0800 From: Huazhong Tan To: CC: , , , , , , Huazhong Tan Subject: [PATCH net-next 01/12] net: hns3: remove an unnecessary 'goto' in hclge_init_ae_dev() Date: Thu, 28 May 2020 21:48:08 +0800 Message-ID: <1590673699-63819-2-git-send-email-tanhuazhong@huawei.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1590673699-63819-1-git-send-email-tanhuazhong@huawei.com> References: <1590673699-63819-1-git-send-email-tanhuazhong@huawei.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [10.69.192.56] X-CFilter-Loop: Reflected Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Remove the redundant 'goto' and return -ENOMEM directly, when allocating memory for 'hdev' fails in hclge_init_ae_dev(). Signed-off-by: Huazhong Tan --- drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c | 6 ++---- 1 file 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 7c9f2ba..0e36f03 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; -- 2.7.4