Re: [PATCH] fix leakes in request_firmware_nowait

From: Andrew Morton
Date: Fri Nov 11 2005 - 21:13:21 EST


matthieu castet <castet.matthieu@xxxxxxx> wrote:
>
> @@ -511,18 +511,23 @@
> {
> struct firmware_work *fw_work = arg;
> const struct firmware *fw;
> + int ret;
> if (!arg) {
> WARN_ON(1);
> return 0;
> }
> daemonize("%s/%s", "firmware", fw_work->name);
> - _request_firmware(&fw, fw_work->name, fw_work->device,
> + ret = _request_firmware(&fw, fw_work->name, fw_work->device,
> fw_work->hotplug);
> - fw_work->cont(fw, fw_work->context);
> - release_firmware(fw);
> + if (ret < 0)
> + fw_work->cont(NULL, fw_work->context);
> + else {
> + fw_work->cont(fw, fw_work->context);
> + release_firmware(fw);
> + }
> module_put(fw_work->module);
> kfree(fw_work);
> - return 0;
> + return ret;
> }

What does the call to fw_work->cont(NULL, ...) do?
-
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/