From mboxrd@z Thu Jan 1 00:00:00 1970 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,URIBL_BLOCKED,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 BAE25C4332F for ; Sun, 8 Sep 2019 12:43:23 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 91F33218AF for ; Sun, 8 Sep 2019 12:43:23 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1567946603; bh=mvzyqS+I5lfi/NFsoStqyrXMLbFW+sd2sHHzUZmUHNw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=wvraWQE2WEOgd6OYChQeauSqdN+u5R51qclJD2J+Pyl6vSshhhGzw4G+IwTJhpykH qNEgOecIYem8O3zsQuaGiDlWI3oWl3JOX/KlV/JQu47zk/j/KkurdVpkKjCoCW7Z8H EFTSUI/ViXoU3M3sPyuEd59qrsj1S2iQBPoV/N9g= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729459AbfIHMnW (ORCPT ); Sun, 8 Sep 2019 08:43:22 -0400 Received: from mail.kernel.org ([198.145.29.99]:57066 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729431AbfIHMnU (ORCPT ); Sun, 8 Sep 2019 08:43:20 -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 29A7A218AF; Sun, 8 Sep 2019 12:43:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1567946599; bh=mvzyqS+I5lfi/NFsoStqyrXMLbFW+sd2sHHzUZmUHNw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=FAFss99gClM/2ubjh2FEyCZpGtLLLFj1QAmN9tXizbj4nfnH1Z2VLW6i+BReRAJrS NjEBNCNSW/D8S0K5rmnH3VY2cjGDjytKeqkLQdX/LM/XmMYFLJhLvJXqXgSvywpjyb cBAC52BRMr+fjBeAusP6n+qpHfjS3LZILKt5O0mE= 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.4 07/23] net: myri10ge: fix memory leaks Date: Sun, 8 Sep 2019 13:41:42 +0100 Message-Id: <20190908121056.307391534@linuxfoundation.org> X-Mailer: git-send-email 2.23.0 In-Reply-To: <20190908121052.898169328@linuxfoundation.org> References: <20190908121052.898169328@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 83651ac8ddb9d..8ebf3611aba3c 100644 --- a/drivers/net/ethernet/myricom/myri10ge/myri10ge.c +++ b/drivers/net/ethernet/myricom/myri10ge/myri10ge.c @@ -4114,7 +4114,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