Received: by 2002:a25:8b12:0:0:0:0:0 with SMTP id i18csp2673956ybl; Thu, 29 Aug 2019 11:17:33 -0700 (PDT) X-Google-Smtp-Source: APXvYqxpcfg9eBT1VZjvsIarYJP6x1j8xvs8B8FJwEix3wzWvY9wUPEzgnsnucyQA9x/wvuatiJl X-Received: by 2002:a62:1bd5:: with SMTP id b204mr12895755pfb.14.1567102653128; Thu, 29 Aug 2019 11:17:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1567102653; cv=none; d=google.com; s=arc-20160816; b=Nf4Cg7RjLhp4HoHEpQ470y+PL36dqixkhTe7WXE7hMw5iutawkIbHX8EjhhChhoyAB dQRznOlMOWm2zeJcYehVDRN5TzVNdqF9KtVVKmJEnPbzCG5TDk+nn9eJhyCNzFgWvsdf aUDRQV8lbuK8lutQnKQN06MMnwmuwT26boL36+cEBmxDm0KvpPwPvjha7o7GSHZKh4Qb CBWpLRvHmtrzHmg+0KCPFf7e8Bagvh/3T/JFOl8SoU1fmvQ9JETnYYqg5mj1YmgjxpE+ LO0yx0T4xsPvHJjFMyysaF+fuPkC+wn2BwMt6eEhAfsdBpMX/6z7iJLORF10AOjOFOvt h/XA== 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 :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=XFrrG0T8LNwr/jdu1S5vwn1uCKt/80zeFXL7xki9J5o=; b=YaB4Mur407r5amP94t+7VcpSgRJ8ecXlKxD1Hi/xaf8GsnnHMSGZU3FYBGUS16Y0Bx H/An13ta6+tVo43an9+fAWpHaKuZSXrxd2RsFu+rs0Pa1IEnVcXPrJLxrD6R535W/X8h u5emrCcOnaLqFwM1MehJqA8NV8FB4TD+ucfcIOkoE3e56VbEPAX6slP19yq9UO838NqG 7WGcX6kQZFI5MT409JxINSx94A78hDKyqVOOa/KBoRmsAwRO+r6hg+gdWUJZOCwhM8or Muj+kp9TqHEy1HBmBTv03ykIkYdRZope9Y4+qAnkeWYEcT3cMIhVZ+UVYuWS4ZZIEkWy KYlw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=aLqWkWDF; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id o5si1214905pll.347.2019.08.29.11.17.17; Thu, 29 Aug 2019 11:17:33 -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=aLqWkWDF; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728911AbfH2SOf (ORCPT + 99 others); Thu, 29 Aug 2019 14:14:35 -0400 Received: from mail.kernel.org ([198.145.29.99]:56172 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728856AbfH2SOc (ORCPT ); Thu, 29 Aug 2019 14:14:32 -0400 Received: from sasha-vm.mshome.net (c-73-47-72-35.hsd1.nh.comcast.net [73.47.72.35]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 821E523428; Thu, 29 Aug 2019 18:14:31 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1567102472; bh=Ki7BrnVVae9IQ9BuydzsEIpn9xfYCx3NtewynpizYIY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=aLqWkWDFZv+IFFq+p8o7D/P9Ava42JCdq2IIax852LRttL/IkJF0DujpuWXgqBHhX D9C3lMPqB0cblzrCcEm7Ls+KkqqzuSMKiJ4Z3chEiS/Vl0Fwc/5/Zr+0q4rXL5LZME Oy4ewt9E3ctWEmPFs9B/aKova9LImzk7jHyoYjeI= From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Wenwen Wang , "David S . Miller" , Sasha Levin , netdev@vger.kernel.org Subject: [PATCH AUTOSEL 5.2 36/76] net: myri10ge: fix memory leaks Date: Thu, 29 Aug 2019 14:12:31 -0400 Message-Id: <20190829181311.7562-36-sashal@kernel.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190829181311.7562-1-sashal@kernel.org> References: <20190829181311.7562-1-sashal@kernel.org> MIME-Version: 1.0 X-stable: review X-Patchwork-Hint: Ignore Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Wenwen Wang [ 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 d8b7fba96d58e..337b0cbfd153e 100644 --- a/drivers/net/ethernet/myricom/myri10ge/myri10ge.c +++ b/drivers/net/ethernet/myricom/myri10ge/myri10ge.c @@ -3919,7 +3919,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