| Date | Wed, 25 Jul 2012 10:49:24 +0800 | Subject | Re: [RFC PATCH 01/13] driver core: firmware loader: simplify pages ownership transfer | From | Ming Lei <> |
| |
On Wed, Jul 25, 2012 at 2:10 AM, Borislav Petkov <bp@amd64.org> wrote: >> >> +/* transfer the ownership of pages to firmware */ >> +static void fw_set_page_data(struct firmware_priv *fw_priv) >> +{ >> + struct firmware *fw = fw_priv->fw; >> + >> + fw_priv->data = vmap(fw_priv->pages, fw_priv->nr_pages, >> + 0, PAGE_KERNEL_RO); > > We don't need to check the return value of vmap() here like we do above?
Good catch, it should be handled, otherwise may cause oops inside driver.
If that happens, the pages buffer should be dropped and return failure from request_firmware or the callback of request_firmware_nowait.
I will fix it against this patch set if cache/uncache firmware can be accepted.
Thanks, -- Ming Lei
|