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,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 8EFFAC4332F for ; Sun, 8 Sep 2019 12:47:49 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 6463E218AC for ; Sun, 8 Sep 2019 12:47:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1567946869; bh=UivBduvDL1eHQ2fBkKVt2wtAyEdzjmGa/pdVwhaTfcU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=yy1Kzmz1SN6zFPHA9OtZaB4i/bRbjIt7v9+ImflqNlHD50O/rMZUjkVZqHUFvGICU NVFn7OPnBbfZEHGVoGrLXt3Aw3qmUnso2Jc6lnsM840cxfV30zxoBn895IuS0arxZg 27wZx1APvE1zeIl67q0nrPOJFj1nS3WkOL4dssQc= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727946AbfIHMrs (ORCPT ); Sun, 8 Sep 2019 08:47:48 -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: stable-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: stable@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