[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <CACVXFVOyfotorQFMirv9kMeT0SDmxzo_MLAk8uvWf8wK=x3YpA@mail.gmail.com>
Date: Fri, 3 Aug 2012 16:34:45 +0800
From: Ming Lei <ming.lei@...onical.com>
To: Borislav Petkov <bp@...64.org>
Cc: Linus Torvalds <torvalds@...ux-foundation.org>,
Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
"Rafael J. Wysocki" <rjw@...k.pl>, linux-kernel@...r.kernel.org
Subject: Re: [RFC PATCH 06/13] driver core: firmware loader: always let
firmware_buf own the pages buffer
On Wed, Jul 25, 2012 at 10:37 PM, Borislav Petkov <bp@...64.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
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists