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: 9422969 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 54C0760484 for ; Fri, 11 Nov 2016 12:41:10 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 45DE729A96 for ; Fri, 11 Nov 2016 12:41:10 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 3828D29A98; Fri, 11 Nov 2016 12:41:10 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.3 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI, RCVD_IN_SORBS_SPAM, T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id BBBA529A96 for ; Fri, 11 Nov 2016 12:41:09 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756317AbcKKMlG (ORCPT ); Fri, 11 Nov 2016 07:41:06 -0500 Received: from mail-lf0-f54.google.com ([209.85.215.54]:33755 "EHLO mail-lf0-f54.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755348AbcKKMlD (ORCPT ); Fri, 11 Nov 2016 07:41:03 -0500 Received: by mail-lf0-f54.google.com with SMTP id c13so11529426lfg.0 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=GNXRhqSKuc+K8K4aRljKCk4Z08fWPiLfOhmIwt2ikYWmP6+LLFIYUorDIoZl8Xlh6H Dz/gLVYmMDpF7Ch61VFMYaf/O7NQ+PV0kD1ndD5cniZTvkjz6p2enyt5C8Z2E//9PFfw KL5ROF5TwzsS6chAYWPrOHE19o7r+/DujMVq9UPsyVB44hJU1JhVXgKepH3Y9Ta849S1 488sScDt3IlE4IlFfYNntWDw9Y/Cmbza1eJAwSGxX6WBQJ4lEuIEa1MlWSE2h2qP8jKy w+oarcBE7kozYt4Z/+pH+BVk6qSJVbrO9vl8hNZfIcKIDY9MZk2H4qdHkyCwhvxe/mnB zXew== X-Gm-Message-State: ABUngvcltxaZwj9Z5mKuoQ1bGmJuVht2UZcQVQWf3irD9qIgsl8RMVE+c7VoJ2CvaYuaXd5Y 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: linux-omap-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-omap@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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(-) 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);