file: ensure cleanup
authorChristian Brauner <brauner@kernel.org>
Sat, 13 Dec 2025 07:45:23 +0000 (08:45 +0100)
committerLinus Torvalds <torvalds@linux-foundation.org>
Sat, 13 Dec 2025 08:04:32 +0000 (20:04 +1200)
commitd2ea4d254d04a89e17504af0230c7268e3cac6bf
tree5d18d85a74f885a11bea3d5f88e266f8ed137830
parentd552fc632cf5b7e3b2808fd341708bd353072c45
file: ensure cleanup

Brown paper bag time. This is a silly oversight where I missed to drop
the error condition checking to ensure we clean up on early error
returns. I have an internal unit testset coming up for this which will
catch all such issues going forward.

Reported-by: Chris Mason <clm@fb.com>
Reported-by: Jeff Layton <jlayton@kernel.org>
Fixes: 011703a9acd7 ("file: add FD_{ADD,PREPARE}()")
Signed-off-by: Christian Brauner <brauner@kernel.org>
Reviewed-by: Jeff Layton <jlayton@kernel.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
include/linux/file.h