Received: by 2002:a5b:505:0:0:0:0:0 with SMTP id o5csp3393790ybp; Sun, 6 Oct 2019 10:58:35 -0700 (PDT) X-Google-Smtp-Source: APXvYqxQL0FbBC+uXpOZ5tdukWOHNV2McFrYc9LI7dG3WEqTy6VsJPYqz/LaeC8O6vN9aD/PX0B0 X-Received: by 2002:a50:9384:: with SMTP id o4mr25407131eda.8.1570384715802; Sun, 06 Oct 2019 10:58:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1570384715; cv=none; d=google.com; s=arc-20160816; b=ZKuQQEph01qWRxTE+IMQ3WJGJTzOv850dKoAxlQsSYD/ULA/S//N+pidtcrwo2jFya 0SrBcTM/cnfTwnwFV3NVVr4uy2Gnw/S2yYohGKLiU9MxtsC265cQ5fONMVPxSLrzq0i9 2lXQI/w+mnor0m2PhJ+oaoI7qXq76jjXPGoQwzd+dF+SwmAeMF4q1/QYBAUMeHhyfivQ a2mrv/4xcMMsVoi4mUsP+OqioqrIpFWpoPhyfHt7rg2abaBZ/lMRy2AlU74vQjpMnQph gvfjyE5AkkR0Da+B4qYR7kVJZxXcVkMGivICTBADT1ZXNxqu8HcV2yXb8i3pcJtwEAeY eYQQ== 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=37aFMImLio3/DmZ8MOFbzQSvxnuPmK9PLA8y68HX0qg=; b=DpWdegSvo00m9ttvA9pNSsJyng3sTghoMUs8KlL5Ab/TKYIskWq4VW+kNFMFSaZgEh 5TVTGC0B5+WZxMbnoINO51npdYnAh2mNkI4AJxrDgLysN6EAMBxeP8hYBnxRs/H1QFIt cwtwnRyewUdPqWjLxOCDOw/64pOGKVfaTQyXpzTwkxZshgV0Qgf6vFYBSHkHub3rDBXL +dvNzi14i9S0j8xicGVKjuccczzT5oTe3Bm6sNEaZ/eMswAM+X4xC6r0zRxENaPZNMkj C+ifDUPoGX4Ih+DXzR4Dl7D/47xi3M+/gSyZFa+blnnqdwK5D4HWy8AB9B+IH7rM5xFq vzuQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=Ay+MiMOH; 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 t9si6076623ejr.29.2019.10.06.10.58.11; Sun, 06 Oct 2019 10:58:35 -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=Ay+MiMOH; 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 S1728890AbfJFRcm (ORCPT + 99 others); Sun, 6 Oct 2019 13:32:42 -0400 Received: from mail.kernel.org ([198.145.29.99]:59154 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728484AbfJFRck (ORCPT ); Sun, 6 Oct 2019 13:32:40 -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 46CB921479; Sun, 6 Oct 2019 17:32:39 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1570383159; bh=PbjHPtewCYuO2ym+Rrsh9hU7Np/igd+boOrZGN37D88=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Ay+MiMOHj8+rFjYdThQX0NjH2OldU650YaxtvbZhnPCQvAoyafo0lftsZLFLNAt+S 0NJkU0a1iDTmuDRBjqqZaJrGMKW9/xlbTCT0UpZvzB89luj950oo18j9jejiBlTl9h MO6cToO2sU6nBrbSEvZUfiMnvKLPwQNuajMZnWno= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Navid Emamdoost , "David S. Miller" Subject: [PATCH 4.19 086/106] net: qlogic: Fix memory leak in ql_alloc_large_buffers Date: Sun, 6 Oct 2019 19:21:32 +0200 Message-Id: <20191006171158.942942590@linuxfoundation.org> X-Mailer: git-send-email 2.23.0 In-Reply-To: <20191006171124.641144086@linuxfoundation.org> References: <20191006171124.641144086@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: Navid Emamdoost [ Upstream commit 1acb8f2a7a9f10543868ddd737e37424d5c36cf4 ] In ql_alloc_large_buffers, a new skb is allocated via netdev_alloc_skb. This skb should be released if pci_dma_mapping_error fails. Fixes: 0f8ab89e825f ("qla3xxx: Check return code from pci_map_single() in ql_release_to_lrg_buf_free_list(), ql_populate_free_queue(), ql_alloc_large_buffers(), and ql3xxx_send()") Signed-off-by: Navid Emamdoost Signed-off-by: David S. Miller Signed-off-by: Greg Kroah-Hartman --- drivers/net/ethernet/qlogic/qla3xxx.c | 1 + 1 file changed, 1 insertion(+) --- a/drivers/net/ethernet/qlogic/qla3xxx.c +++ b/drivers/net/ethernet/qlogic/qla3xxx.c @@ -2788,6 +2788,7 @@ static int ql_alloc_large_buffers(struct netdev_err(qdev->ndev, "PCI mapping failed with error: %d\n", err); + dev_kfree_skb_irq(skb); ql_free_large_buffers(qdev); return -ENOMEM; }