Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp492202ybl; Tue, 28 Jan 2020 06:48:29 -0800 (PST) X-Google-Smtp-Source: APXvYqynbrz08l4Mp8GmH6wzrxHo1fzk3tY9vDfTZTODxoMW6X58siwCfVZgQ53sxs2jCmuNNKlF X-Received: by 2002:a05:6830:2110:: with SMTP id i16mr16510084otc.337.1580222909574; Tue, 28 Jan 2020 06:48:29 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1580222909; cv=none; d=google.com; s=arc-20160816; b=F7bpmpd1MONlTqRZAzrFRTWbHUmhh75GxtNp+SeYA5BVXsUQEYKa77MxWEOe6hX9ph 6TqXY9kdqhXReb0u//MPiG9UyCN0LBRZa46+KWJkAn88S0Y83WUuHaWo7++B3Pj22Fyo dj7C61chn4KSlbuQT5/y8vLGpeDc63cdcQR/HpUtXW4p9I8d+26kwUFKTPxD8h5HXesf rVOTCvDXMX9eHKl6A7nwOrt9hGGFxBi2GER3a45EVNET1ROWs3kzQuGHn0FPqr/gCTM8 FKAbuhg55M3zIZ9NLtro8uT38fiUO+ZgD3lFnXqkKeU2G869RMLyczsc+9XYKjyDiy5B pioQ== 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=MpmSNDbYjC/8aMmsqwcvzseaNvBxjvg9Oo90zQa6aWY=; b=COx+dIhrPKXzK9z2klehYCjbv8NnLsKnpebryfG4GWU5r4F7SXDY5DNTpg+aA67U0J dB4Gxq4gdEzzuaVVYYAbCgOiMOpWPJAgudZfhVQZdAixVT/lD44hQvqWcATItygTT4CL wJ3xa6Ey8Pt1sYv2lzaqooa2JWepeUX3GCDb+DJ5rvg9SG1bkjAT7HWMjdUqVun75ji0 tnjfugvC4xlMV67cUsodd3v2DbKEMtAufiRS11+A7vQlaHvDJD7/nk7EwWmu9X+g1PT0 7a86ADUnpJ8MzJ52CrnceiU53CphWOLmYTD3+1eCiWyWFgohVrBSUs4YkUlpWAV4VhbO IxJw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=1Jwmosmu; 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 h17si5387884oih.53.2020.01.28.06.48.17; Tue, 28 Jan 2020 06:48:29 -0800 (PST) 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=1Jwmosmu; 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 S1731309AbgA1Ohi (ORCPT + 99 others); Tue, 28 Jan 2020 09:37:38 -0500 Received: from mail.kernel.org ([198.145.29.99]:44720 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730992AbgA1OUE (ORCPT ); Tue, 28 Jan 2020 09:20:04 -0500 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 71A2E2071E; Tue, 28 Jan 2020 14:20:03 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1580221203; bh=pfZmhNclWOdVpmT+NIxCBYUPY2XlVApOtvbptFEVmxY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=1Jwmosmuj0NtmQQ/RVdwjRPlQ68caS6QYsxJfsyYz2KZUTts5nBoZntFmuwsFM3Dz zUJTioM0R29zECZO+BfVEZ9n5LBZblOmME0VN5yjjA9TDlEv1a/al4zNbXFXKNLwir 8h4cSVuAx1rui7PPYF2Sp6j3/nnde3d7x/wscbi8= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Arthur Kiyanovski , Sameeh Jubran , "David S. Miller" , Sasha Levin Subject: [PATCH 4.9 130/271] net: ena: fix: Free napi resources when ena_up() fails Date: Tue, 28 Jan 2020 15:04:39 +0100 Message-Id: <20200128135902.279642467@linuxfoundation.org> X-Mailer: git-send-email 2.25.0 In-Reply-To: <20200128135852.449088278@linuxfoundation.org> References: <20200128135852.449088278@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: Sameeh Jubran [ Upstream commit b287cdbd1cedfc9606682c6e02b58d00ff3a33ae ] ena_up() calls ena_init_napi() but does not call ena_del_napi() in case of failure. This causes a segmentation fault upon rmmod when netif_napi_del() is called. Fix this bug by calling ena_del_napi() before returning error from ena_up(). Fixes: 1738cd3ed342 ("net: ena: Add a driver for Amazon Elastic Network Adapters (ENA)") Signed-off-by: Arthur Kiyanovski Signed-off-by: Sameeh Jubran Signed-off-by: David S. Miller Signed-off-by: Sasha Levin --- drivers/net/ethernet/amazon/ena/ena_netdev.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/net/ethernet/amazon/ena/ena_netdev.c b/drivers/net/ethernet/amazon/ena/ena_netdev.c index 961f31c8356b7..da21886609e30 100644 --- a/drivers/net/ethernet/amazon/ena/ena_netdev.c +++ b/drivers/net/ethernet/amazon/ena/ena_netdev.c @@ -1702,6 +1702,7 @@ err_setup_rx: err_setup_tx: ena_free_io_irq(adapter); err_req_irq: + ena_del_napi(adapter); return rc; } -- 2.20.1