summaryrefslogtreecommitdiff
path: root/mm/memfd_luo.c
diff options
context:
space:
mode:
Diffstat (limited to 'mm/memfd_luo.c')
-rw-r--r--mm/memfd_luo.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/mm/memfd_luo.c b/mm/memfd_luo.c
index 01a72e4d3ef6..a34fccc23b6a 100644
--- a/mm/memfd_luo.c
+++ b/mm/memfd_luo.c
@@ -447,7 +447,8 @@ static int memfd_luo_retrieve(struct liveupdate_file_op_args *args)
file = memfd_alloc_file("", 0);
if (IS_ERR(file)) {
pr_err("failed to setup file: %pe\n", file);
- return PTR_ERR(file);
+ err = PTR_ERR(file);
+ goto free_ser;
}
vfs_setpos(file, ser->pos, MAX_LFS_FILESIZE);
@@ -473,7 +474,8 @@ static int memfd_luo_retrieve(struct liveupdate_file_op_args *args)
put_file:
fput(file);
-
+free_ser:
+ kho_restore_free(ser);
return err;
}