Re: [PATCH] firmware: Don't attempt to allocate zero bytes with vmalloc()

From: Ming Lei
Date: Tue Oct 09 2012 - 08:02:13 EST


On Tue, Oct 9, 2012 at 3:52 PM, Mark Brown
<broonie@xxxxxxxxxxxxxxxxxxxxxxxxxxx> wrote:

> The point is that there's some firmware which the driver wants to load
> but where it's happy to continue if the user didn't provide one and
> doesn't want to introduce needless delays.

OK, I got it, thank you for sharing the use case.

If loading directly, the patch isn't needed because filp_open() can
return failure on non-existent file.

If loading via user space, timeout or not depends on userspace,
at least udev won't timeout on non-existent firmware image.

Also looks request_firmware_nowait() is better for the case, _nowait()
can avoid unnecessary delay and speedup firmware loading if there
are more than one firmware to load.

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/