Received: by 2002:a25:c593:0:0:0:0:0 with SMTP id v141csp4110046ybe; Mon, 9 Sep 2019 04:29:19 -0700 (PDT) X-Google-Smtp-Source: APXvYqxiuazTkjFnbKER8Hh4ulM6OTQRzuJUVhjna13ulm8wECRi+KFQmdKO8zqVmlzY7SExZK1l X-Received: by 2002:a17:906:b254:: with SMTP id ce20mr19000513ejb.129.1568028559823; Mon, 09 Sep 2019 04:29:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1568028559; cv=none; d=google.com; s=arc-20160816; b=choJDmOKcB+JGuJ56HCf0WwsM+g4Yt6TnCVmrThOVB8Mr+/j6beauOlYmK9XDzrV7o MDD1qMIlmq8HddxKbk44cbIOF99Ngh1MoLQgkkJ/8WHMHd6/1iTOR+iSp2kqNZB/vmH0 pVOzTNxHUtaC3Qsjgq7STuRh6i04X5vpwATPKHmq6hE4pWTDsdNiafyCAHLFMvJ/DHCP Np0vxb4vplE5J6o+yPSxxxrBAF9vbgTvPgkGQkJ50toacMU7GUPyH9VEjQ2tc3CCpb09 pxRwbstxkaFwcT2VvGEoT/XxaPc4hO0Ck3iX4KCPXAkayKvPqgiUqWc8MEs1gure3Edg b5kQ== 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=oYRaoyx+rI9y8XsUgMa/2F1MfY61HBTBDuk7VTXCDv4=; b=qFlFjrUFWm0kcVpXa0lg0DXcpUPNDuYqPdLb1aM+DI7U6pp1JA7w4oL55orw04RP80 E9p+NeXW6uR8KXtlODsGFr3bxQJl5aRtnzTXsp0UlSRQC2eDBktS9oeNcvzA6FuW/e8D 6MpC9Bj3T3B4JIv8+EGOAKSuxZZJekdPajIA1y7U4oaSgE39cYBAMRSFUfehocW+81ts NAkEYNm5R3gczPRyXY+ohFsSPmrcse8k32Uijb88AU4JNwM3D1r3nDtDnjluTvNLVsZ2 AMN1XlIDmFhYT3whmFoYc+Jxf7uFRJARFtVhwE2vq7U2S7LIxz/YDDBPLsx4gOCobZlk 88oA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=GPmNNjao; 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 m23si7050515eja.89.2019.09.09.04.28.56; Mon, 09 Sep 2019 04:29:19 -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=GPmNNjao; 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 S1730796AbfIHMrt (ORCPT + 99 others); Sun, 8 Sep 2019 08:47:49 -0400 Received: from mail.kernel.org ([198.145.29.99]:36366 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730759AbfIHMrq (ORCPT ); Sun, 8 Sep 2019 08:47:46 -0400 Received: from localhost (unknown [62.28.240.114]) (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 2D011218AC; Sun, 8 Sep 2019 12:47:45 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1567946865; bh=UivBduvDL1eHQ2fBkKVt2wtAyEdzjmGa/pdVwhaTfcU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=GPmNNjaoWtGUlilsBoxawooT2ghV/e7fka2c0vUpUP3MlUDDdm1orMmNi9KM9CncD t5xw23XTlIR84ym/tcGwbZ0KTES+mrS7niL/+wgUk3T/jFNaZQeuLPU3tVejvdquYy 0cMLP8ozCQEUVRTeDIMAmubei33yvxwSflxZ47VY= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Wenwen Wang , "David S. Miller" , Sasha Levin Subject: [PATCH 4.19 29/57] net: myri10ge: fix memory leaks Date: Sun, 8 Sep 2019 13:41:53 +0100 Message-Id: <20190908121136.696803282@linuxfoundation.org> X-Mailer: git-send-email 2.23.0 In-Reply-To: <20190908121125.608195329@linuxfoundation.org> References: <20190908121125.608195329@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 [ Upstream commit 20fb7c7a39b5c719e2e619673b5f5729ee7d2306 ] In myri10ge_probe(), myri10ge_alloc_slices() is invoked to allocate slices related structures. Later on, myri10ge_request_irq() is used to get an irq. However, if this process fails, the allocated slices related structures are not deallocated, leading to memory leaks. To fix this issue, revise the target label of the goto statement to 'abort_with_slices'. Signed-off-by: Wenwen Wang Signed-off-by: David S. Miller Signed-off-by: Sasha Levin --- drivers/net/ethernet/myricom/myri10ge/myri10ge.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/ethernet/myricom/myri10ge/myri10ge.c b/drivers/net/ethernet/myricom/myri10ge/myri10ge.c index b2d2ec8c11e2d..6789eed78ff70 100644 --- a/drivers/net/ethernet/myricom/myri10ge/myri10ge.c +++ b/drivers/net/ethernet/myricom/myri10ge/myri10ge.c @@ -3922,7 +3922,7 @@ static int myri10ge_probe(struct pci_dev *pdev, const struct pci_device_id *ent) * setup (if available). */ status = myri10ge_request_irq(mgp); if (status != 0) - goto abort_with_firmware; + goto abort_with_slices; myri10ge_free_irq(mgp); /* Save configuration space to be restored if the -- 2.20.1