kernel/vfs: Unlock KPath buffers after copying them.

Otherwise we will call UnlockBuffer() when we potentially never
called LockBuffer().

Fixes #15157.
This commit is contained in:
Augustin Cavalier 2019-07-13 13:46:19 -04:00
parent 39665db167
commit 14cbb958bd

View File

@ -8809,6 +8809,7 @@ _user_mount(const char* userPath, const char* userDevice,
B_PATH_NAME_LENGTH);
if (status != B_OK)
return status;
path.UnlockBuffer();
if (userFileSystem != NULL) {
if (!IS_USER_ADDRESS(userFileSystem))
@ -8827,6 +8828,7 @@ _user_mount(const char* userPath, const char* userDevice,
B_PATH_NAME_LENGTH);
if (status != B_OK)
return status;
device.UnlockBuffer();
}
if (userArgs != NULL && argsLength > 0) {
@ -8847,8 +8849,6 @@ _user_mount(const char* userPath, const char* userDevice,
return status;
}
}
path.UnlockBuffer();
device.UnlockBuffer();
status = fs_mount(path.LockBuffer(),
userDevice != NULL ? device.Path() : NULL,