lkml.org 
[lkml]   [2012]   [Aug]   [3]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
SubjectRe: [RFC PATCH 06/13] driver core: firmware loader: always let firmware_buf own the pages buffer
From
On Wed, Jul 25, 2012 at 10:37 PM, Borislav Petkov <bp@amd64.org> wrote:
> On Wed, Jul 25, 2012 at 01:00:06AM +0800, Ming Lei wrote:

>> @@ -213,13 +291,8 @@ static ssize_t firmware_loading_show(struct device *dev,
>> /* firmware holds the ownership of pages */
>> static void firmware_free_data(const struct firmware *fw)
>> {
>> - int i;
>> - vunmap(fw->data);
>> - if (fw->pages) {
>> - for (i = 0; i < PFN_UP(fw->size); i++)
>> - __free_page(fw->pages[i]);
>> - kfree(fw->pages);
>> - }
>> + WARN_ON(!fw->priv);
>> + fw_free_buf(fw->priv);
>
> Why the WARN_ON?

Because the 'struct firmware' instance is exposed to drivers, it is
better to warn if some drivers clear it during request&release.

Thanks,
--
Ming Lei


\
 
 \ /
  Last update: 2012-08-03 11:21    [W:0.297 / U:0.824 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site