Received: by 2002:a25:8b12:0:0:0:0:0 with SMTP id i18csp188635ybl; Thu, 15 Aug 2019 15:20:08 -0700 (PDT) X-Google-Smtp-Source: APXvYqzQTbopvFOEpz2OhtlK1dRncWAWwu8NjIMrO3d116C+SYNCIFoMv5TMMuSpz22RUqcE+3Rm X-Received: by 2002:a65:6891:: with SMTP id e17mr5267969pgt.305.1565907607898; Thu, 15 Aug 2019 15:20:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1565907607; cv=none; d=google.com; s=arc-20160816; b=Ckq+fugAJEYP5I/fTUCS6I9lAW6rIswP//eAeoQG7Kp5efzjKYaeOIiMFm7v3kOJu1 heVE6kWgLPaCPWEpJ7EV4IWqkmDY7gS+6ci87VyHaPu7yzVIeEz2eZZgCWsbCTof4UHF H1Oy8ZmWcQilFzuaGIsbvG8tlGkPSp9d6W9qs8fILAyRiyeD/5G2Yu0rGTxwXm7ti0p3 TG9xqlGKd+UZjYv/wCLdh+7heJFtZPLRN+88MYRRyjDXnxiSrqhJwuwsJ7Kgb1xtVwD6 wOgsj+i/GxUzjjhOvvK0uEtywOHj7lJkoBZATrISXur+9rElWGrnxz6QYssdVZX7K/p8 NSRw== 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 :references:in-reply-to:from:subject:cc:to:message-id:date; bh=GpXSxtp7o83M57tzaCTj4dvel6q1HES4hgluyA0ZHPs=; b=HMXHnHRR3P6i6klv4xt0KdFxb3aAt2oPLTXO3W1ZF1k3UVpozHL3pz99ZZHEz2p4c0 IMoUy4Ph0kPUu9YNQT+hInRJlR4sxGEpjFtizDJbhB5P8lHxAPHdwbthW2NadcWLoHwz NY8iY7KGL2zOk/3lmLsUqeaGXtLHmA8pTdOcEUUu7D90qntyEYveeQDWUr/SniFRwF7x Ib2kQWmfR/84u5cqgf7+jp3S0mvq8huqWEdYOyoWeoUsw5LCUmh1XLqWiSMwmWOgsJLd zqqB3RVSyZfZf4ODLe31s5gkpligb2+3icDuV2ppHjoVU6EkTxTaZDSj/8SZWjW7Nyb1 7QXQ== 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 q18si2708784pll.79.2019.08.15.15.19.44; Thu, 15 Aug 2019 15:20:07 -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 S1732606AbfHOTeb (ORCPT + 99 others); Thu, 15 Aug 2019 15:34:31 -0400 Received: from shards.monkeyblade.net ([23.128.96.9]:49046 "EHLO shards.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729366AbfHOTeb (ORCPT ); Thu, 15 Aug 2019 15:34:31 -0400 Received: from localhost (unknown [IPv6:2601:601:9f80:35cd::d71]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) (Authenticated sender: davem-davemloft) by shards.monkeyblade.net (Postfix) with ESMTPSA id 9A4EA1400EDB8; Thu, 15 Aug 2019 12:34:30 -0700 (PDT) Date: Thu, 15 Aug 2019 12:34:30 -0700 (PDT) Message-Id: <20190815.123430.831231953098536795.davem@davemloft.net> To: wenwen@cs.uga.edu Cc: rfontana@redhat.com, allison@lohutok.net, alexios.zavras@intel.com, gregkh@linuxfoundation.org, tglx@linutronix.de, netdev@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] net: pch_gbe: Fix memory leaks From: David Miller In-Reply-To: <1565746427-5366-1-git-send-email-wenwen@cs.uga.edu> References: <1565746427-5366-1-git-send-email-wenwen@cs.uga.edu> X-Mailer: Mew version 6.8 on Emacs 26.1 Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.5.12 (shards.monkeyblade.net [149.20.54.216]); Thu, 15 Aug 2019 12:34:30 -0700 (PDT) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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.