Re: [RFC PATCH 01/13] driver core: firmware loader: simplify pagesownership transfer

From: Ming Lei
Date: Tue Jul 24 2012 - 22:49:22 EST


On Wed, Jul 25, 2012 at 2:10 AM, Borislav Petkov <bp@xxxxxxxxx> 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
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/