blob_to_mnt(): kern_unmount() is needed to undo kern_mount()
plain mntput() won't do. Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
This commit is contained in:
parent
f6957b7191
commit
279b192c23
1 changed files with 2 additions and 2 deletions
|
|
@ -28,7 +28,7 @@ static struct vfsmount *blob_to_mnt(const void *data, size_t len, const char *na
|
||||||
|
|
||||||
file = file_open_root_mnt(mnt, name, O_CREAT | O_WRONLY, 0700);
|
file = file_open_root_mnt(mnt, name, O_CREAT | O_WRONLY, 0700);
|
||||||
if (IS_ERR(file)) {
|
if (IS_ERR(file)) {
|
||||||
mntput(mnt);
|
kern_unmount(mnt);
|
||||||
return ERR_CAST(file);
|
return ERR_CAST(file);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -38,7 +38,7 @@ static struct vfsmount *blob_to_mnt(const void *data, size_t len, const char *na
|
||||||
if (err >= 0)
|
if (err >= 0)
|
||||||
err = -ENOMEM;
|
err = -ENOMEM;
|
||||||
filp_close(file, NULL);
|
filp_close(file, NULL);
|
||||||
mntput(mnt);
|
kern_unmount(mnt);
|
||||||
return ERR_PTR(err);
|
return ERR_PTR(err);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue