1
0
mirror of https://github.com/golang/go synced 2024-11-23 04:40:09 -07:00

syscall: fs_nacl: Unlock() should be deferred.

Change-Id: Iea08b8f4e74a8cd4b4d317273046457c8db956a1
Reviewed-on: https://go-review.googlesource.com/1640
Reviewed-by: Minux Ma <minux@golang.org>
Reviewed-by: Russ Cox <rsc@golang.org>
This commit is contained in:
Peter Armitage 2014-12-16 14:12:48 +00:00 committed by Russ Cox
parent ab9ec2e401
commit 47c7cf4357

View File

@ -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 {