Commit 47c7cf43 authored by Peter Armitage's avatar Peter Armitage Committed by Russ Cox

syscall: fs_nacl: Unlock() should be deferred.

Change-Id: Iea08b8f4e74a8cd4b4d317273046457c8db956a1
Reviewed-on: https://go-review.googlesource.com/1640Reviewed-by: 's avatarMinux Ma <minux@golang.org>
Reviewed-by: 's avatarRuss Cox <rsc@golang.org>
parent ab9ec2e4
......@@ -815,7 +815,7 @@ func fdToFsysFile(fd int) (*fsysFile, error) {
// It is meant to be called when initializing the file system image.
func create(name string, mode uint32, sec int64, data []byte) error {
fs.mu.Lock()
fs.mu.Unlock()
defer fs.mu.Unlock()
f, err := fs.open(name, O_CREATE|O_EXCL, mode)
if err != nil {
if mode&S_IFMT == S_IFDIR {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment