Close fd on error path in do_mount()

This fix closes a file descriptor before returning
error from do_mount()

Change-Id: Ib370229f16bf9ac385162d6b163cc5b079a1e73e
This commit is contained in:
Tomasz Kondel 2014-02-06 08:57:27 +01:00 committed by JP Abgrall
parent ca1797ae00
commit bfdcc40bff
1 changed files with 1 additions and 0 deletions

View File

@ -433,6 +433,7 @@ int do_mount(int nargs, char **args)
sprintf(tmp, "/dev/block/loop%d", n);
loop = open(tmp, mode);
if (loop < 0) {
close(fd);
return -1;
}