From patchwork Thu Apr 12 18:18:08 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: sjur.brandeland@stericsson.com X-Patchwork-Id: 152156 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 86503B70BF for ; Fri, 13 Apr 2012 04:18:22 +1000 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S934586Ab2DLSST (ORCPT ); Thu, 12 Apr 2012 14:18:19 -0400 Received: from mail-lpp01m010-f46.google.com ([209.85.215.46]:42120 "EHLO mail-lpp01m010-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S934579Ab2DLSSR (ORCPT ); Thu, 12 Apr 2012 14:18:17 -0400 Received: by mail-lpp01m010-f46.google.com with SMTP id j13so1789545lah.19 for ; Thu, 12 Apr 2012 11:18:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:from:to:cc:subject:date:message-id:x-mailer:in-reply-to :references:mime-version:content-type:content-transfer-encoding; bh=3iHhD2t4MrHP9RSVLWMLY6aGC7sTtGo6/9dc/bdlVGM=; b=Ff6JFrBUU3C3yc1Av/+rEhAERDtqyFEx+LuJdztk8HvKD4bdlBWq0JfmEK1+oECW3i tAwBHrWw4i2YdOp3BGhMFtXmsB65bDa0XNRgiO2uHTwejFNt67RwA647Ti5iwJ0Ef+al 2vplBt1IhsDYGkRGY7f/K6GNgxWU4QW9CSp8z40S3p/rEtAKHXuTiEBRiqpwJVqzDl2I uHvOW4AnyQW5ahYLeA/R4l1bQ7b7fUku/PXbTu6R9iDOdDa2Jm+MIEUDeEp8Qm3XmsDb 9/7mtgcTyBd3iUwKMueY3im4TZXsMa4OuZmRH+hddMj1y62MlpwoB0njyqQMAAkk9GFN E/aw== Received: by 10.152.132.166 with SMTP id ov6mr3341861lab.35.1334254696953; Thu, 12 Apr 2012 11:18:16 -0700 (PDT) Received: from localhost.localdomain ([212.4.57.94]) by mx.google.com with ESMTPS id uc6sm8644912lbb.3.2012.04.12.11.18.15 (version=TLSv1/SSLv3 cipher=OTHER); Thu, 12 Apr 2012 11:18:16 -0700 (PDT) From: =?UTF-8?q?Sjur=20Br=C3=A6ndeland?= To: netdev@vger.kernel.org, davem@davemloft.net Cc: sjurbren@gmail.com Subject: [PATCH net 2/3] caif-hsi: Free flip_buffer at shutdown Date: Thu, 12 Apr 2012 20:18:08 +0200 Message-Id: <1334254689-2843-3-git-send-email-sjur.brandeland@stericsson.com> X-Mailer: git-send-email 1.7.0.4 In-Reply-To: <1334254689-2843-1-git-send-email-sjur.brandeland@stericsson.com> References: <1334254689-2843-1-git-send-email-sjur.brandeland@stericsson.com> MIME-Version: 1.0 Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org Fix memory leak of RX flip-buffer. Signed-off-by: Sjur Brændeland --- drivers/net/caif/caif_hsi.c | 5 +++-- 1 files changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/net/caif/caif_hsi.c b/drivers/net/caif/caif_hsi.c index 9a66e2a..d0d9a6f 100644 --- a/drivers/net/caif/caif_hsi.c +++ b/drivers/net/caif/caif_hsi.c @@ -1210,7 +1210,7 @@ int cfhsi_probe(struct platform_device *pdev) static void cfhsi_shutdown(struct cfhsi *cfhsi) { - u8 *tx_buf, *rx_buf; + u8 *tx_buf, *rx_buf, *flip_buf; /* Stop TXing */ netif_tx_stop_all_queues(cfhsi->ndev); @@ -1234,7 +1234,7 @@ static void cfhsi_shutdown(struct cfhsi *cfhsi) /* Store bufferes: will be freed later. */ tx_buf = cfhsi->tx_buf; rx_buf = cfhsi->rx_buf; - + flip_buf = cfhsi->rx_flip_buf; /* Flush transmit queues. */ cfhsi_abort_tx(cfhsi); @@ -1247,6 +1247,7 @@ static void cfhsi_shutdown(struct cfhsi *cfhsi) /* Free buffers. */ kfree(tx_buf); kfree(rx_buf); + kfree(flip_buf); } int cfhsi_remove(struct platform_device *pdev)