Re: [PATCH] loop: fix backing file reference leak on validation error

From: Markus Elfring

Date: Sun Sep 28 2025 - 09:48:39 EST



> Fix this by calling fput(file) before returning the error.

> +++ b/drivers/block/loop.c


How do you think about to increase the application of scope-based resource management?
https://elixir.bootlin.com/linux/v6.17-rc7/source/include/linux/file.h#L97

Regards,
Markus