Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754757AbbKXSJ3 (ORCPT ); Tue, 24 Nov 2015 13:09:29 -0500 Received: from shards.monkeyblade.net ([149.20.54.216]:43304 "EHLO shards.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754169AbbKXSJ1 (ORCPT ); Tue, 24 Nov 2015 13:09:27 -0500 Date: Tue, 24 Nov 2015 13:09:24 -0500 (EST) Message-Id: <20151124.130924.1365382562223060152.davem@davemloft.net> To: zhengsq@rock-chips.com Cc: peppe.cavallaro@st.com, linux-kernel@vger.kernel.org, linux-rockchip@lists.infradead.org, netdev@vger.kernel.org, dianders@google.com Subject: Re: [PATCH v1] net: stmmac: Free rx_skbufs before realloc From: David Miller In-Reply-To: <1448181858-5935-2-git-send-email-zhengsq@rock-chips.com> References: <1448181858-5935-1-git-send-email-zhengsq@rock-chips.com> <1448181858-5935-2-git-send-email-zhengsq@rock-chips.com> X-Mailer: Mew version 6.6 on Emacs 24.5 / Mule 6.0 (HANACHIRUSATO) 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]); Tue, 24 Nov 2015 10:09:27 -0800 (PST) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 922 Lines: 28 From: Shunqian Zheng Date: Sun, 22 Nov 2015 16:44:18 +0800 > From: ZhengShunQian > > The init_dma_desc_rings() may realloc the rx_skbuff[] when > suspend and resume. This patch free the rx_skbuff[] before > reallocing memory. > > Signed-off-by: ZhengShunQian This isn't really the right way to fix this. I see two reasonable approaches: 1) suspend liberates the RX ring, although this approach is less desirable 2) resume doesn't try to allocate already populated RX ring entries Freeing the whole RX ring just to allocate it again immediately makes no sense at all and is wasteful work. -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/