Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp215598ybi; Fri, 26 Jul 2019 08:35:42 -0700 (PDT) X-Google-Smtp-Source: APXvYqxXhQnW0iuciuYWlVLbwWkhmWrxGpAAvD3tZNB7wR8yhDjZSIwAm2YMqo2yFoeqSzZCdMPX X-Received: by 2002:a63:b346:: with SMTP id x6mr92269438pgt.218.1564155342592; Fri, 26 Jul 2019 08:35:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1564155342; cv=none; d=google.com; s=arc-20160816; b=VFVpm3E6lQWlFraP7+Pf26oM5XxgUqSb47F5DNQGQXIxQiELdpQB39b0tAhurQ++i1 0IecD2XfOiG6d7Ibw4D0BinR/z/kQcq2ifZn6aGsmPZ6VfZH/I/QOwDDEgtIUcFLqr2w hNe8mAKym94d3geqX8sE0DsDasKq2cWSnpmIZbT97CLel8Mo/bePlVsutMzBwfACzIrA CdH4Fv90DPV3/pOoHm+M8mCWjvUhX11KruilpRuQmsyayDIceET5GhebriKv2jyeTQv9 rAt0nEctchiVdmWpvVHqi2W45Q+8kiw8pqvVp+aOwXzOF2LVLowzKhq9DHjNOwSo1qof iKDw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=nhz3PUUP3et5JFJtSg7/1hXP945MM6QEjGt3Mj9XhMQ=; b=OIDTPZyfhp3QVmNyPbFh7R1YVk4wxcFygwOOOdWPcjY50aWv6tMPKHjzjep/cn85X2 uk2V3jkWDmMdhBCLs/9IIR+EWuP/P8cGuaeI5KoiEGwBGCMwuL88NMzoolu7FOFvS3S6 QKUBWUcXqeJQ/2r/7N/MPHjC+hB4OVOjHUxjXKS4BMKPR5W7a/Asxw3YQpfzF2M7scY3 3cYT5rRN5g9WrXMLAyZMRyle4OZ9en0A6LRay7nnZtNcroCSdBMA59Igz55OdnuFU2Hc j7KR41C3whQjaQawTRPt1I2CVh2A+3inRMgobuNmPdN0pjxMEoBcCgde6MXyFmTTMtmA 0mzw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=PCH4TTrR; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id l1si19265707pgt.137.2019.07.26.08.35.27; Fri, 26 Jul 2019 08:35:42 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=PCH4TTrR; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2389569AbfGZPcx (ORCPT + 99 others); Fri, 26 Jul 2019 11:32:53 -0400 Received: from mail.kernel.org ([198.145.29.99]:48042 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2389547AbfGZPcq (ORCPT ); Fri, 26 Jul 2019 11:32:46 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 8E3BB20644; Fri, 26 Jul 2019 15:32:45 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1564155166; bh=Qu5C3pPl3pwTZRF/1RD436IutAMq/y9vFw1kouuIs3c=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=PCH4TTrRUMJl6MTiQt60pjEIFMbvutNLq7PCWh0kQXhZyVHEN+wS2ZtG1ABjlob8M IroBSWvVXH3jiIaiG5T43ya5o6IeU98Ru48py9XicA0DvrjcUv+8jpuasz727Tzvls bj9lvIipVbJt0pM+fEzZVV2ZYVf4O9IFRFRsOdwA= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Aya Levin , Feras Daoud , Saeed Mahameed Subject: [PATCH 4.19 24/50] net/mlx5e: IPoIB, Add error path in mlx5_rdma_setup_rn Date: Fri, 26 Jul 2019 17:24:59 +0200 Message-Id: <20190726152303.052173118@linuxfoundation.org> X-Mailer: git-send-email 2.22.0 In-Reply-To: <20190726152300.760439618@linuxfoundation.org> References: <20190726152300.760439618@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Aya Levin [ Upstream commit ef1ce7d7b67b46661091c7ccc0396186b7a247ef ] Check return value from mlx5e_attach_netdev, add error path on failure. Fixes: 48935bbb7ae8 ("net/mlx5e: IPoIB, Add netdevice profile skeleton") Signed-off-by: Aya Levin Reviewed-by: Feras Daoud Signed-off-by: Saeed Mahameed Signed-off-by: Greg Kroah-Hartman --- drivers/net/ethernet/mellanox/mlx5/core/ipoib/ipoib.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) --- a/drivers/net/ethernet/mellanox/mlx5/core/ipoib/ipoib.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/ipoib/ipoib.c @@ -662,7 +662,9 @@ struct net_device *mlx5_rdma_netdev_allo profile->init(mdev, netdev, profile, ipriv); - mlx5e_attach_netdev(epriv); + err = mlx5e_attach_netdev(epriv); + if (err) + goto detach; netif_carrier_off(netdev); /* set rdma_netdev func pointers */ @@ -678,6 +680,11 @@ struct net_device *mlx5_rdma_netdev_allo return netdev; +detach: + profile->cleanup(epriv); + if (ipriv->sub_interface) + return NULL; + mlx5e_destroy_mdev_resources(mdev); destroy_ht: mlx5i_pkey_qpn_ht_cleanup(netdev); destroy_wq: