Received: by 2002:a25:c593:0:0:0:0:0 with SMTP id v141csp4050875ybe; Mon, 9 Sep 2019 03:27:05 -0700 (PDT) X-Google-Smtp-Source: APXvYqw6M0DvmH0jQs9r+VgtxMYnTlQ1X50g0IEPdWSkjLv7ZbHucWHjNU7d4kQC/+H3EtQX0L5x X-Received: by 2002:a50:9fce:: with SMTP id c72mr23886058edf.166.1568024825402; Mon, 09 Sep 2019 03:27:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1568024825; cv=none; d=google.com; s=arc-20160816; b=0Y5Jnvnehsv0BTlKNZ7UhLdsZuI6RqTS2kC45EyLQr8uxTLB/OAO1ZeVgnZIB7o9mN rc7PvuYlbpatKVqDHiNFA1HtGb9xmdcMGYKkoZx4MLP9rdGWqL17ZYUV1y6nHqwWMp4x wX6eaPlNnTOBnlxAZdaLMhYZqEQ8mcqmfAUyFjH2sGqsmVcqaQ8f2cGU06iTzjI45Z4k RKEbPLHM/N/pCdfmyD+v5YwNyPIuw+GEjmQytGi6R9bCF1GNGC0AMwf0RNBJpVKIeqED 5Vqm39h5uZ5PwSTxhfDSaOO0U83BCtom/qxVj2+ftjJRM3JeTSIVNekzMs7UZwVlsyz5 oyWA== 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=1oH9DBhunL0rzWzYqXOhoRyTuLG78PY8SbNqshtHb9I=; b=yje4E4c9U53fleuxAGZApubInF/GJANUdNL0bo3ymPhZdZvOMmZIYqRs8tSB3q73tc n1hek79ut65Xh8CspmS6+Qll9PL7cobSdXH7moOxHOREJ0xhlE9Mub7Pe2zTuOaH/a/y k5lrqzY6dsVIKSEDw6Iy9IfAWP4BuIsQB2IFhob6oXGNX7x8mPXO+MtavjK9/ZUYTpjy fz57P9ckRYPOXqT2Z0JwtYUQ2OtzrLwkci9rqYajxnhrZci7TQKFMVSqKOzBzFvQo0jh rjywKfNB0xuyZiRzaO2hpIGp4QGKwFFSNbKfpuHENZdlb//MW4xY48Wf6F8zpmy8qTU+ tkJg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=T1I1ej9d; 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 o24si7040436ejb.296.2019.09.09.03.26.41; Mon, 09 Sep 2019 03:27:05 -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=T1I1ej9d; 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 S1732720AbfIHMvk (ORCPT + 99 others); Sun, 8 Sep 2019 08:51:40 -0400 Received: from mail.kernel.org ([198.145.29.99]:43164 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732675AbfIHMvf (ORCPT ); Sun, 8 Sep 2019 08:51:35 -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 6C2CC2196F; Sun, 8 Sep 2019 12:51:34 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1567947094; bh=R4TG00Gp+qz4loKg0EFU3QYEx6+A4QxhkV1zPIdgigM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=T1I1ej9dyVDxndFYuVPnyXFJOyS6uxPh1a4LIxm8WOOiTLCsL06RyGlBfjd42NlFW 08dXIw5HM+9GWkZeBW9wxJqx0wqPU18LyZF7G5jYHBfNKng28oGXQ/iwpLdNrXibuX q8TjS7eVAvKZ3tRytK+4QhacVufrJVJemTVNSTns= 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 5.2 52/94] net: myri10ge: fix memory leaks Date: Sun, 8 Sep 2019 13:41:48 +0100 Message-Id: <20190908121151.926741421@linuxfoundation.org> X-Mailer: git-send-email 2.23.0 In-Reply-To: <20190908121150.420989666@linuxfoundation.org> References: <20190908121150.420989666@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 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