Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932088AbbG1Fxj (ORCPT ); Tue, 28 Jul 2015 01:53:39 -0400 Received: from mx12-05.smtp.antispamcloud.com ([46.165.232.175]:57213 "EHLO mx12-05.smtp.antispamcloud.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752372AbbG1Fxh convert rfc822-to-8bit (ORCPT ); Tue, 28 Jul 2015 01:53:37 -0400 Message-ID: <55B718D1.2030803@topic.nl> Date: Tue, 28 Jul 2015 07:53:21 +0200 From: Mike Looijmans Organization: TOPIC User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.7.0 MIME-Version: 1.0 To: Kalle Valo CC: , , , , Subject: Re: [PATCH] rsi: Fix failure to load firmware after memory leak fix and fix the leak References: <1437975813-3285-1-git-send-email-mike.looijmans@topic.nl> <87wpxlao8l.fsf@kamboji.qca.qualcomm.com> In-Reply-To: <87wpxlao8l.fsf@kamboji.qca.qualcomm.com> Content-Type: text/plain; charset="utf-8"; format=flowed Content-Transfer-Encoding: 8BIT X-Originating-IP: [192.168.80.121] X-EXCLAIMER-MD-CONFIG: 9833cda7-5b21-4d34-9a38-8d025ddc3664 X-EXCLAIMER-MD-BIFURCATION-INSTANCE: 0 X-Filter-ID: s0sct1PQhAABKnZB5plbIbbvfIHzQjPVmPLZeVYSu3xU9luQrU+8/8qthi+0Jd/W6KAUC/fjyuDn NXFr4uarw1SwxpfMeXHl5mVXKEseC20nrHTiHvudKHCHZ1B2UXUbf2aAaV5Xo/UtwGC8qMniFe6l J+1QbRWAkJgpd+bixwV2O2a+1IXsrPr+aAj/oBRe28SYmcwCPj/ZzmJsv0ebQk1RkjFSt0gGNzxK 1QPte7J/4JJLWU05KN2DSnwKez0FidMlhCno/QsYaTlhyywkGcOdtodIdebYjgcRyt4wHyOrK6je rlezqXsbb1/G9Ow2jP2fRxwJHAKm/HbWBr+UtOs+cxk/hmn1scabtn74rhUWQUsEqgWAt8uEnHkZ xbq5N65gKrwL06rrDmuOrWGrUFFfEoXm0/FPF8PR0w363lnAKNziv+RmNbQCPz5iGiddexaWM+73 y45Bz4mCkdp8ynDEFV8q8EixEy0WHr0MBnBWBb39uS1TjWG2Inx+Ts2QR5VpRkY2y0i1dot2e/p+ /h7SY7BUeWNB86CoDOED7em8KTDM0IIXx9OFWXdMggdrERWeKKG4PAQYNyavp7c49AmAkppdCINc gFyCW+g5ivegkiwlR7QlB1DzvApmj5TBnyPdXTzsaUU55PiR3xUU+GnFBaN/eBsz5D9zrZ7SO9s1 1Iy42FkLdf+cZ0MpjKD71NIcFf62DBYTA2/MdGAE2N8fNSoXzcmzFq/G7AgI3mZ8FU2/hl/GK9ND ThaPMyoZVsp2VMbDAtRNxMUM7IoK/hNkLqCjiId6WAvv91OEwwsnxZXs6H4JY8KS1PFwEsGuKLYj D7i5Avrv6/Ywl79BHn3LrKg2F0PLkW7RIR4Ln3DQpg7IR5s494cl7Tg5r9a99jihx+Za/cV70jOJ zN2r4A== X-Report-Abuse-To: spam@mx99.antispamcloud.com X-Filter-Fingerprint: IFrWXGses7OKB5S5G8/dJUb3OPwsHaH0Fvg5oXltHd/JUWjZ8+qhjyB23tbDuyLOYL8Ff78gYsez 4Rl08xudmXi4esCQ0R1MchVjt7wblGlvhFgW0MjUMRkF5sMCDfftTXNFDzN17hnrWeZYOJvLq0Ic WjZ+XcEjj/7Pkld0zkmvziDInX9WdMov2kn2yXjdwv61T+KDYyYtREgszdyFwv8IxCB3p/oCKvxr eyISh3JGb7OS5oVgiO+kDxZrVPLz3MmEGC2PrUKqLq5WmHK+Nw== X-Originating-IP: 88.159.208.100 X-Spampanel-Domain: topic.nl X-Spampanel-Username: 88.159.208.100 Authentication-Results: antispamcloud.com; auth=pass smtp.auth=88.159.208.100@topic.nl X-Spampanel-Outgoing-Class: ham X-Spampanel-Outgoing-Evidence: Combined (0.00) X-Recommended-Action: accept Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2180 Lines: 65 On 27-07-15 12:28, Kalle Valo wrote: > Mike Looijmans writes: > >> Fixes commit eae79b4f3e82ca63a53478a161b190a0d38fe526 ("rsi: fix memory leak >> in rsi_load_ta_instructions()") which stopped the driver from functioning. > > You can abbreviate the commit id: > > 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. >> >> 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. >> >> Signed-off-by: Mike Looijmans > > Add this before Signed-off-by line: > > Fixes: eae79b4f3e82 ("rsi: fix memory leak in rsi_load_ta_instructions()") > >> Cc: stable@vger.kernel.org > > Also no need to send email to stable@vger.kernel.org list, this line is > enough and the stable team will pick the commit automatically. I wondered why that happened, and just noticed that git send-email automatically added this to the recipients. So it happened for v2 as well, sorry for that. Kind regards, Mike Looijmans System Expert TOPIC Embedded Products Eindhovenseweg 32-C, NL-5683 KH Best Postbus 440, NL-5680 AK Best Telefoon: +31 (0) 499 33 69 79 Telefax: +31 (0) 499 33 69 70 E-mail: mike.looijmans@topicproducts.com Website: www.topicproducts.com Please consider the environment before printing this e-mail -- 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/