From patchwork Fri Jan 24 09:28:36 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 232977 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.8 required=3.0 tests=DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id D91A9C35242 for ; Fri, 24 Jan 2020 11:19:25 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id A4CA720704 for ; Fri, 24 Jan 2020 11:19:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1579864765; bh=ZeetClQyM9NU8OTPpj+VUorkOREUTMGfbCUZh2s5Yno=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=CFkQDEsmviwlFgeqDHsKP4mVnfBvQ+3tNru119K63fnrR/GOHVCNxPcU2lCaGxHLH Bxa6Szmpudtz/p78uWkIbC/BUrAocniHEtJBtBm08vgF+mRLIvWL3g66Ci2tYefzvq qpHV+eS/daBPyzJb+LerhkFb3PvaCH1mjVL5dmc4= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2390783AbgAXLTY (ORCPT ); Fri, 24 Jan 2020 06:19:24 -0500 Received: from mail.kernel.org ([198.145.29.99]:56806 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2390781AbgAXLTY (ORCPT ); Fri, 24 Jan 2020 06:19:24 -0500 Received: from localhost (ip-213-127-102-57.ip.prioritytelecom.net [213.127.102.57]) (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 A2496208C4; Fri, 24 Jan 2020 11:19:22 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1579864763; bh=ZeetClQyM9NU8OTPpj+VUorkOREUTMGfbCUZh2s5Yno=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=PesXtBLdkeH3m/w25zPGOJ5j3t+ua64xFQlvMvfiXZ/bUn4U5Yg3xTwyDmV6DnwyA upmqieGjNo5hSMAWta++agwUdbdtCzxE3bKMFL6ZE2jAwWe2ra/9MUL9NqTUxYoiuj PwNSqu0Ocl7oy1xEMdp8xCjaIxSOr2nOQpG/TuH4= 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.19 346/639] net: ena: fix: Free napi resources when ena_up() fails Date: Fri, 24 Jan 2020 10:28:36 +0100 Message-Id: <20200124093130.481792466@linuxfoundation.org> X-Mailer: git-send-email 2.25.0 In-Reply-To: <20200124093047.008739095@linuxfoundation.org> References: <20200124093047.008739095@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Sender: stable-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: stable@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 e26c195fec83b..9afb19ebba580 100644 --- a/drivers/net/ethernet/amazon/ena/ena_netdev.c +++ b/drivers/net/ethernet/amazon/ena/ena_netdev.c @@ -1800,6 +1800,7 @@ err_setup_rx: err_setup_tx: ena_free_io_irq(adapter); err_req_irq: + ena_del_napi(adapter); return rc; }