From patchwork Fri Nov 11 12:39:03 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ivan Khoronzhuk X-Patchwork-Id: 81822 Delivered-To: patch@linaro.org Received: by 10.140.97.165 with SMTP id m34csp1245205qge; Fri, 11 Nov 2016 04:41:07 -0800 (PST) X-Received: by 10.98.211.135 with SMTP id z7mr6580877pfk.109.1478868066965; Fri, 11 Nov 2016 04:41:06 -0800 (PST) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id o5si9998029pgh.134.2016.11.11.04.41.06; Fri, 11 Nov 2016 04:41:06 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of netdev-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org; spf=pass (google.com: best guess record for domain of netdev-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=netdev-owner@vger.kernel.org; dmarc=pass (p=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756229AbcKKMlE (ORCPT + 4 others); Fri, 11 Nov 2016 07:41:04 -0500 Received: from mail-lf0-f46.google.com ([209.85.215.46]:34980 "EHLO mail-lf0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755195AbcKKMlD (ORCPT ); Fri, 11 Nov 2016 07:41:03 -0500 Received: by mail-lf0-f46.google.com with SMTP id b14so11461969lfg.2 for ; Fri, 11 Nov 2016 04:41:02 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id; bh=k+qZ7QbePH76SKARem+Gryk9QB2k/MZnb63OBzZP++M=; b=WxAYfuv8xA8NXwoiO9iYcGp4QOG7TaeqFylYoKQzvRo/wtKsXLYmvqWE28pVdtAPah MYBlk9bsCSgj8TEPHTKsaDrV1AhmSKKaPpllprFtmrKQpc3WPwd2mO1LFECEEefrUTQe Bzeaze5SdE4ZHHk/sCzijQCLmenjKusnUq2EM= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=k+qZ7QbePH76SKARem+Gryk9QB2k/MZnb63OBzZP++M=; b=mIBx3ea4fK2201ZRUHPiZmA00M9SK7K8ny4QTKlahM6fBp52MarqPKRz2BgWaD/BAI 50ZzsklpL1r1MktxfSgoPtS4bCoKvvn875V3UHJDb9QCUC3yEV2/prCeThyduYmBwIEH hdG4AL+446wQA0fNKWiOnyFOa98DmE9Xsjbs4fRhVYd4wdkqH6r775ZN1P+kzII6C/oH lTj63wxt6ASlneAEetFIrMCnnDodyiVAjRPg1w8e8WF1I7c0KMFzU/wGwn1lveQWzEhA uS1+5zAqywk6phSuooZcodcmQyYnCuFudAiNWPvykqBSN6To43CCDNN4KQDr3UkEKXaW 2FUw== X-Gm-Message-State: ABUngvdgC/ovpWEREEScEbFLUu6rbbMjwmEgK7WV11uvmOGXb+mNO3a/yN4uOMZ75RgQLWFw X-Received: by 10.25.125.84 with SMTP id y81mr1285083lfc.37.1478868061474; Fri, 11 Nov 2016 04:41:01 -0800 (PST) Received: from localhost.localdomain (183-224-132-95.pool.ukrtel.net. [95.132.224.183]) by smtp.gmail.com with ESMTPSA id 29sm2155182lfs.5.2016.11.11.04.41.00 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 11 Nov 2016 04:41:00 -0800 (PST) From: Ivan Khoronzhuk To: mugunthanvnm@ti.com, grygorii.strashko@ti.com, netdev@vger.kernel.org Cc: linux-omap@vger.kernel.org, linux-kernel@vger.kernel.org, Ivan Khoronzhuk Subject: [PATCH v2] net: ethernet: ti: davinci_cpdma: free memory while channel destroy Date: Fri, 11 Nov 2016 14:39:03 +0200 Message-Id: <1478867943-21083-1-git-send-email-ivan.khoronzhuk@linaro.org> X-Mailer: git-send-email 1.9.1 Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org While create/destroy channel operation memory is not freed. It was supposed that memory is freed while driver remove. But a channel can be created and destroyed many times while changing number of channels with ethtool. Reviewed-by: Grygorii Strashko Signed-off-by: Ivan Khoronzhuk --- Based on net-next/master drivers/net/ethernet/ti/davinci_cpdma.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -- 1.9.1 diff --git a/drivers/net/ethernet/ti/davinci_cpdma.c b/drivers/net/ethernet/ti/davinci_cpdma.c index 05afc05..07fc92d 100644 --- a/drivers/net/ethernet/ti/davinci_cpdma.c +++ b/drivers/net/ethernet/ti/davinci_cpdma.c @@ -586,7 +586,7 @@ int cpdma_chan_destroy(struct cpdma_chan *chan) cpdma_chan_stop(chan); ctlr->channels[chan->chan_num] = NULL; ctlr->chan_num--; - + devm_kfree(ctlr->dev, chan); cpdma_chan_split_pool(ctlr); spin_unlock_irqrestore(&ctlr->lock, flags);