Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752518AbbGaGXP (ORCPT ); Fri, 31 Jul 2015 02:23:15 -0400 Received: from smtp.codeaurora.org ([198.145.29.96]:38600 "EHLO smtp.codeaurora.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751302AbbGaGXN (ORCPT ); Fri, 31 Jul 2015 02:23:13 -0400 Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: Re: [v2] rsi: Fix failure to load firmware after memory leak fix and fixthe leak From: Kalle Valo In-Reply-To: <1438062661-3173-1-git-send-email-mike.looijmans@topic.nl> To: Mike Looijmans Cc: linux-wireless@vger.kernel.org, khoroshilov@ispras.ru, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, Mike Looijmans , stable@vger.kernel.org Message-Id: <20150731062312.CF880140A4E@smtp.codeaurora.org> Date: Fri, 31 Jul 2015 06:23:12 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1291 Lines: 30 > Fixes commit eae79b4f3e82 ("rsi: fix memory leak in rsi_load_ta_instructions()") > which stopped the driver from functioning. > > Firmware data has been allocated using vmalloc(), resulting in memory > that cannot be used for DMA. Hence the firmware was first copied to a > buffer allocated with kmalloc() in the original code. This patch reverts > the commit and only calls "kfree()" to release the buffer after sending > the data. This fixes the memory leak without breaking the driver. > > Add a comment to the kmemdup() calls to explain why this is done, and abort > if memory allocation fails. > > Tested on a Topic Miami-Florida board which contains the rsi SDIO chip. > > Also added the same kfree() call to the USB glue driver. This was not > tested on actual hardware though, as I only have the SDIO version. > > Fixes: eae79b4f3e82 ("rsi: fix memory leak in rsi_load_ta_instructions()") > Signed-off-by: Mike Looijmans > Cc: stable@vger.kernel.org Thanks, applied to wireless-drivers.git. Kalle Valo -- 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/