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=-12.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED 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 6CE74C48BE5 for ; Sat, 12 Jun 2021 18:14:18 +0000 (UTC) Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 33F7A6108D for ; Sat, 12 Jun 2021 18:14:16 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 33F7A6108D Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 001A180377; Sat, 12 Jun 2021 20:14:14 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="GGJ26MCJ"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 2800780377; Sat, 12 Jun 2021 20:14:13 +0200 (CEST) Received: from mail-ed1-x52c.google.com (mail-ed1-x52c.google.com [IPv6:2a00:1450:4864:20::52c]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 99864800AA for ; Sat, 12 Jun 2021 20:14:10 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=rfried.dev@gmail.com Received: by mail-ed1-x52c.google.com with SMTP id b11so40987317edy.4 for ; Sat, 12 Jun 2021 11:14:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:content-transfer-encoding:date:message-id:cc:subject :from:to:references:in-reply-to; bh=js3UVETTNPk7ILhXAKhMvdywH9aH71gSpydssX1I1HE=; b=GGJ26MCJ2RnQkL4rVvgBMr+/uESPQqyhqehxnJuxMq+5oAuebsnyPlFGcLjd2oTGNa E/LcdwHVjrV3p66Af+PKOmn4wU4xoP4qrYtMTXfYdWgWCt8ClXFMDWk/EZRoJX+sHsi/ 2ho+z3+phTD4INZRD66VCnm+wSwQDoAYWlUf4uqzP9bGqwAv3MWWzoT9tzl1wdo54Noi j/4+U9x3Vlbcr20vOnAU+D9UiBDrra6/FzssvewR1e9o3KUJHeKJSaA+h60I1zA1peVY 9aEB9wGEE2E0NVwXJZHLBEQf2+DLrHTolQAeGDGdrtqZ1vEl3GFHJebSqUCkpqGOBgZD ErrA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:content-transfer-encoding:date :message-id:cc:subject:from:to:references:in-reply-to; bh=js3UVETTNPk7ILhXAKhMvdywH9aH71gSpydssX1I1HE=; b=ZMMqdtda7k4viC9b5WluhKTgbqdl5gev40s4eyxuBpaitMnz1z3q0ZqPK+YwTbny4g TRNTRlYe9Ae/8EqImw/jLS3e6015JLhZd2BoVG7qSWkG3aUVcbheiiv28jDkSj9cVU9j B3Oq3S9QvZeMLNKSqQ/C4WG9yc1neVtlDRYbc+HG3lSXDXCbddgeb66ZXcc7G+WjcSii f5oLtNWSnzalCoR0P3h5tyYgnPWfgnxDelZ1lrAOK6FG0KvfE7VML3b5EUcRbf3LbjZy SlcZbkb6pNensBpn7scHgdf5TvrCZoQD9MESYUQXUx8wDNS/vhdGTcFrfiZBcA4y6SHN vaUQ== X-Gm-Message-State: AOAM5319zYnvzGpxo5TAiI5ehTaeSBDwsiZmAo748jtRdVf/d+u7NLFB Wqzwjcewb7xOj1JNqM4g+hWspZ5seRRxqQ== X-Google-Smtp-Source: ABdhPJyQWL1PVJjyWxOI4clFC6A9q29LxUrGyL94Wu4zZvvLUjx4sUIxYBsVfHDL8oMuNN6fnxW43A== X-Received: by 2002:a05:6402:543:: with SMTP id i3mr9652568edx.173.1623521650241; Sat, 12 Jun 2021 11:14:10 -0700 (PDT) Received: from localhost ([2a00:a040:198:e68a::1004]) by smtp.gmail.com with ESMTPSA id b25sm4320598edv.9.2021.06.12.11.14.08 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sat, 12 Jun 2021 11:14:09 -0700 (PDT) Mime-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=UTF-8 Date: Sat, 12 Jun 2021 21:14:07 +0300 Message-Id: Cc: Subject: Re: [PATCH] net: fm: Fix a memory leak issue From: "Ramon Fried" To: "Zhiqiang Hou" , , , References: <20210602063554.25281-1-Zhiqiang.Hou@nxp.com> In-Reply-To: <20210602063554.25281-1-Zhiqiang.Hou@nxp.com> X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.34 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.103.2 at phobos.denx.de X-Virus-Status: Clean On Wed Jun 2, 2021 at 9:35 AM IDT, Zhiqiang Hou wrote: > From: Hou Zhiqiang > > Fix a memory leak issue in the RX port initialization. > > Signed-off-by: Hou Zhiqiang > --- > drivers/net/fm/eth.c | 4 +++- > 1 file changed, 3 insertions(+), 1 deletion(-) > > diff --git a/drivers/net/fm/eth.c b/drivers/net/fm/eth.c > index 0e89e663f7..7c23ccc1f0 100644 > --- a/drivers/net/fm/eth.c > +++ b/drivers/net/fm/eth.c > @@ -288,8 +288,10 @@ static int fm_eth_rx_port_parameter_init(struct > fm_eth *fm_eth) > =20 > /* alloc Rx buffer from main memory */ > rx_buf_pool =3D malloc(MAX_RXBUF_LEN * RX_BD_RING_SIZE); > - if (!rx_buf_pool) > + if (!rx_buf_pool) { > + free(rx_bd_ring_base); > return -ENOMEM; > + } > =20 > memset(rx_buf_pool, 0, MAX_RXBUF_LEN * RX_BD_RING_SIZE); > debug("%s: rx_buf_pool =3D %p\n", __func__, rx_buf_pool); > -- > 2.17.1 Applied to u-boot-net/master, thanks! Best regards, Ramon Fried