From patchwork Tue Nov 8 13:16:05 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ivan Khoronzhuk X-Patchwork-Id: 9417351 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 668756022E for ; Tue, 8 Nov 2016 13:16:42 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 5908B212D6 for ; Tue, 8 Nov 2016 13:16:42 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 4D15D28F0D; Tue, 8 Nov 2016 13:16:42 +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 9E81E28B76 for ; Tue, 8 Nov 2016 13:16:41 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751454AbcKHNQM (ORCPT ); Tue, 8 Nov 2016 08:16:12 -0500 Received: from mail-lf0-f48.google.com ([209.85.215.48]:34548 "EHLO mail-lf0-f48.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750974AbcKHNQK (ORCPT ); Tue, 8 Nov 2016 08:16:10 -0500 Received: by mail-lf0-f48.google.com with SMTP id o141so66935173lff.1 for ; Tue, 08 Nov 2016 05:16:09 -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=HbMsZAiuhP26VtdCAeEiW+zu2yJ1q7/8s0S1v1kxBk4=; b=KIMnP5L0RTmTojcALFbMM5P3kqe0WyKcXqxBuMz5CBOt3iqDD3jdRbLW7DpcTW3R8Q nw6nD7Is0Vao8cYhPzVF1+raVLEFNp8XdTMRJjDiOyMz0yyslZFGFp1stTclr6AlXeId PINuKb0FiBjtb5YdzwhAgLaKQ8Xa86UzcyCQU= 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=HbMsZAiuhP26VtdCAeEiW+zu2yJ1q7/8s0S1v1kxBk4=; b=OVyHRPZaCAdbn1U2cnZtY2hHC2Acd/mmtjdTsD+R8N90Xo4fkFwt0PgTazMQQckRcy pgDP8zAVfgGJSjqU2wnx8Q6Fmz0h7VrlQ0dG0c7rD/3U8XgtUUkxg6T8zrZqyAypnlzL QbN9ZG0WWEb293aQkDs+4tQjXSUczPEMsvcHos1txXyCCSq59cu6+eXGpIbjb+1Jkcxj mmuj45HkbUxV7yrNR8hXwh4kJA6vXl6U1NzzC0Qq1PkJyjyk7eOCOcTkPFW3+DSCdIQN N+fJxMud+b5T3wR19d8SbkuKkVDGOk8XV2kIq2QDxWWr+9VH7qsHNz1jm+tzfTlnqM8P iNKw== X-Gm-Message-State: ABUngvdDu2i9UHz2VsFFEicD1BX88BpSF4jjEJqeag9kJA4d4stUrttFlFtWAbAFfdr2y+Fq X-Received: by 10.25.23.101 with SMTP id n98mr7213927lfi.147.1478610968909; Tue, 08 Nov 2016 05:16:08 -0800 (PST) Received: from localhost.localdomain (167-203-94-178.pool.ukrtel.net. [178.94.203.167]) by smtp.gmail.com with ESMTPSA id f42sm5058191lji.43.2016.11.08.05.16.07 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 08 Nov 2016 05:16:08 -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] net: ethernet: ti: davinci_cpdma: free memory while channel destroy Date: Tue, 8 Nov 2016 15:16:05 +0200 Message-Id: <1478610965-25288-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. Based on net-next/master Signed-off-by: Ivan Khoronzhuk Reviewed-by: Grygorii Strashko --- 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);