Received: by 2002:a25:8b12:0:0:0:0:0 with SMTP id i18csp111962ybl; Thu, 15 Aug 2019 13:42:41 -0700 (PDT) X-Google-Smtp-Source: APXvYqxu8auBJ63EdwSzKh+REJblLCE1EVGrMZOqu+xR1U8dSlO0z0XCPj7d3PY1ktYpe3Vk5iOX X-Received: by 2002:a63:fe52:: with SMTP id x18mr5125263pgj.344.1565901760774; Thu, 15 Aug 2019 13:42:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1565901760; cv=none; d=google.com; s=arc-20160816; b=t3BI0Inrc6D6hft4ox2Z27oljphpBkKXGDAmjYF0pQMWCb2daeHJol1u0l+QWcLfDz GLZ/2SheI7aL5q3GBrHvUUHR2JBCxpAlYOCY7a/mjHIOaYViW72k30Ol0qdCK2pv6zPl 3iSB36iq+lSqlCoV2XTSFkSbPFF6QgrEOxVGM64cbpLhaCCwhOjf1HqXtbSKH2C2klak KmZvYgcqBvIZGCJrmMdKvFSR7FozAJLUjjGar/qPU/s5hWYd0MjnwXqACV1n253WbQno XgO74HjPk0c+w8cUXjlXWLNEW7EYiXc9fBhf/CiU99z9nJuEGXTmjJfmVG25D/yb5TEo H3zw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version; bh=pHxTRnHS6dUcW+7Wgv0R9bj0F4V7KdrUqVYOyimQAp4=; b=nyYy6i4JgJXuS1tWWOMVOz/cnidaSdSkEXq+MpSsoL8rfpLML8bxGEHjnC2N0NNhbp VhkpKVro2y3xu23b9z0qMx5lqyr2BKQjz6VrZmN0aA974sSYpqn8/vxjFoqRoU+QQVYr NeO8a51qDwyLmtWPAgzsPLwimBzr8Uol9lGmVli7w/3WCMzg52HArPSb4vyeKghFOQST eoZol0Mt/ZGvChlQr8jYujZqllZIeS9DYk6HcNXUCW+Wg/f7kXslGWjtEB6Jg4oj7Tt+ /eYOGubmgPvSu7IXiqZ/XPJwmTIfytyp8tJ9kk2OkHhK70cwmCZNPEhb/V5NNI3IfXx1 ioPw== ARC-Authentication-Results: i=1; mx.google.com; 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 w4si2575511plq.1.2019.08.15.13.42.22; Thu, 15 Aug 2019 13:42:40 -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; 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 S1733227AbfHOUET (ORCPT + 99 others); Thu, 15 Aug 2019 16:04:19 -0400 Received: from ajax.cs.uga.edu ([128.192.4.6]:58534 "EHLO ajax.cs.uga.edu" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731196AbfHOUES (ORCPT ); Thu, 15 Aug 2019 16:04:18 -0400 Received: from mail-lj1-f170.google.com (mail-lj1-f170.google.com [209.85.208.170]) (authenticated bits=0) by ajax.cs.uga.edu (8.14.4/8.14.4) with ESMTP id x7FK4Glf077418 (version=TLSv1/SSLv3 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL); Thu, 15 Aug 2019 16:04:17 -0400 Received: by mail-lj1-f170.google.com with SMTP id t14so3303098lji.4; Thu, 15 Aug 2019 13:04:17 -0700 (PDT) X-Gm-Message-State: APjAAAXsCRc9iH4LVC+LmNeSc+CyO58hdcx1hlsVZ96JP/9atBQtBYxQ P7Gc21e/vHTAy3nPDqKt76lTytzWBSiAU4+d4xo= X-Received: by 2002:a2e:89da:: with SMTP id c26mr3015536ljk.214.1565899455773; Thu, 15 Aug 2019 13:04:15 -0700 (PDT) MIME-Version: 1.0 References: <1565746427-5366-1-git-send-email-wenwen@cs.uga.edu> <20190815.123430.831231953098536795.davem@davemloft.net> In-Reply-To: <20190815.123430.831231953098536795.davem@davemloft.net> From: Wenwen Wang Date: Thu, 15 Aug 2019 16:03:39 -0400 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH] net: pch_gbe: Fix memory leaks To: David Miller Cc: Richard Fontana , Allison Randal , Alexios Zavras , Greg Kroah-Hartman , Thomas Gleixner , "open list:NETWORKING [GENERAL]" , open list , Wenwen Wang Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Aug 15, 2019 at 3:34 PM David Miller wrote: > > From: Wenwen Wang > Date: Tue, 13 Aug 2019 20:33:45 -0500 > > > In pch_gbe_set_ringparam(), if netif_running() returns false, 'tx_old' and > > 'rx_old' are not deallocated, leading to memory leaks. To fix this issue, > > move the free statements after the if branch. > > > > Signed-off-by: Wenwen Wang > > Why would they be "deallocated"? They are still assigned to > adapter->tx_ring and adapter->rx_ring. 'adapter->tx_ring' and 'adapter->rx_ring' has been covered by newly allocated 'txdr' and 'rxdr' respectively before this if statement. Wenwen